command line: bitcoin-cli verifychain

5 replies 259 views
cybergasFull Member
Posts: 93 · Reputation: 505
#1Oct 25, 2022, 12:26 PM
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.
3 Reply Quote Share
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
3 Reply Quote Share
cybergasFull Member
Posts: 93 · Reputation: 505
#3Oct 25, 2022, 04:04 PM
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?
2 Reply Quote Share
cybergasFull Member
Posts: 93 · Reputation: 505
#4Oct 25, 2022, 11:37 PM
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:
2 Reply Quote Share
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.
4 Reply Quote Share
cybergasFull Member
Posts: 93 · Reputation: 505
#6Oct 28, 2022, 09:52 AM
Thank you, found the pertinent info in the debug.log.
2 Reply Quote Share

Related topics