Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: 22bits on May 24, 2024, 05:00:44 AM



Title: command line: bitcoin-cli verifychain
Post by: 22bits on May 24, 2024, 05:00:44 AM
Running on Ubuntu not sure how to pass parameters to the bitcoin-cli -verifychain command.  Works fine with curl or programmatic interface, but not sure how to just type it in at the prompt and have it work. 
Code:
$bitcoin-cli verifychain <how do I put parameters here?>
I see it takes two parameters which I would like to pass in on the command line.


Title: Re: command line: bitcoin-cli verifychain
Post by: nc50lc on May 24, 2024, 05:37:52 AM
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


Title: Re: command line: bitcoin-cli verifychain
Post by: 22bits on May 24, 2024, 10:33:39 AM
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?


Title: Re: command line: bitcoin-cli verifychain
Post by: 22bits on May 24, 2024, 12:40:12 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:
Code:
{"result":false,"error":null,"id":2}



Title: Re: command line: bitcoin-cli verifychain
Post by: nc50lc on May 25, 2024, 05:10:47 AM
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.


Title: Re: command line: bitcoin-cli verifychain
Post by: 22bits on May 29, 2024, 02:23:42 PM
Thank you, found the pertinent info in the debug.log.