How to use bitcoin-cli verifychain on Ubuntu?

5 replies 401 views
raven1337Hero Member
Posts: 10 · Reputation: 2116
#1Oct 6, 2025, 03:31 AM
I'm on Ubuntu and can’t figure out how to use the -verifychain option with bitcoin-cli. Works fine with curl but typing it directly isn't clicking for me. I know it needs two parameters, but where do I put them?
6 Reply Quote Share
0xChadNewbie
Posts: 138 · Reputation: 3
#2Oct 7, 2025, 03:35 AM
From what I understand, just put the two numbers right after the command, separated by a space. You could also try named to specify the parameter names. Like this: $bitcoin-cli named verifychain checklevel=1 nblocks=0.
6 Reply Quote Share
raven1337Hero Member
Posts: 10 · Reputation: 2116
#3Oct 7, 2025, 09:13 AM
That actually worked! But here’s the kicker when I run verifychain, it always says true, except for when I set nblocks=0 to check all blocks. Then it goes false. Is this a timeout issue or something?
3 Reply Quote Share
raven1337Hero Member
Posts: 10 · Reputation: 2116
#4Oct 7, 2025, 02:59 PM
Trying to figure that out too. When I check with higher block counts, it keeps returning false with the error: null. Just ran it with 4 and 500 blocks. No clue what's going on.
2 Reply Quote Share
0xChadNewbie
Posts: 138 · Reputation: 3
#5Oct 7, 2025, 07:30 PM
Check your 'debug.log' for more details. Look in your bitcoin datadir. You should see lines that start with "Verifying last <N> blocks at level <N>" and end with "Verification: <message>". The nBlocks and level should match what you’re checking against.
1 Reply Quote Share
raven1337Hero Member
Posts: 10 · Reputation: 2116
#6Oct 7, 2025, 11:01 PM
Thanks! Just found the info I needed in debug.log. That helped a lot.
0 Reply Quote Share

Related topics