verifychain

blockchain expensive since 0.9.0

verifies each entry in the local block chain database.

Share: X Bluesky Mastodon Reddit HN
↑ shares the docs page. Use Share this query below for a link with your current arg values.
Expensive RPC. CPU- or scan-heavy. Cached and rate-limited per IP to keep the node healthy. Public execution is disabled for this RPC. It will reopen to authenticated users in a future release.
Call from your own code

Replace $BITCOIN_RPC_USER / $BITCOIN_RPC_PASSWORD with credentials from your bitcoind's bitcoin.conf, and replace localhost:8332 with your node's RPC address. You can't run this RPC against our node, but you can run it against your own bitcoind.

Help

verifychain ( checklevel nblocks )

Verifies blockchain database.

Arguments:
1. checklevel    (numeric, optional, default=3, range=0-4) How thorough the block verification is:
                 - level 0 reads the blocks from disk
                 - level 1 verifies block validity
                 - level 2 verifies undo data
                 - level 3 checks disconnection of tip blocks
                 - level 4 tries to reconnect the blocks
                 - each level includes the checks of the previous levels
2. nblocks       (numeric, optional, default=6, 0=all) The number of blocks to check.

Result:
true|false    (boolean) Verified or not

Examples:
> bitcoin-cli verifychain 
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "verifychain", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/

← back to all RPCs