I'm using Ubuntu, and I'm kinda stuck on how to use parameters with the bitcoin-cli -verifychain command. It works well with curl and other programmatic stuff, but I'm not sure how to just type it in at the command line and get it to run. I know it needs two parameters that I wanna pass in directly.
command line: bitcoin-cli verifychain
5 replies 259 views
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#2Oct 25, 2022, 02:05 PM
AFAIK it should just take the two positional arg's numeric values right after the command, each separated by whitespace.
You can also try to use --named arg and specify the command parameters' names.
Like for example:$bitcoin-cli --named verifychain checklevel=1 nblocks=0
OK that works great. When I run the verifychain with any parameter it always returns true, except when nblocks=0 which specifies it should read all blocks. When nblocks=0 it always returns false. Also larger numbers return false. Would it be some kind of timeout issue?
I am trying to track this down. getblockchaininfo looks good. verifychain with higher block counts returns false with error: null. Not really sure what the cause might be. sample run for 4, 500.
response follows:
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#5Oct 27, 2022, 08:18 PM
Check you recent 'debug.log' entries for more detailed result. (located in bitcoin datadir)
The lines related to verifychain command should start from "Verifying last <N> blocks at level <N>" line to "Verification: <message>" result.
The "nBlocks" and "verification level" should match the command that returned that 'error: null' response.
Thank you, found the pertinent info in the debug.log.
Related topics
- bitcoin-qt sync issues and slow speeds 6
- Recovering a Bitcoin wallet and address 8
- Affordable quiet mini PC for running a Bitcoin node and blockchain explorer 19
- Using two different Bitcoin versions without messing up blockchain data 3
- Issue with Bitcoin Core Wallet after power outage 8
- Is it possible to check my bitcoin balance offline 12