verifychain RPC verifies each entry in the local block chain database.
Parameter #1—how thoroughly to check each block
|Check Level||number (int)||Optional
(0 or 1)
|How thoroughly to check each block, from 0 to 4. Default is the level set with the
0. Read from disk to ensure the files are accessible
1. Ensure each block is valid
2. Make sure undo files can be read from disk and are in a valid format
3. Test each block undo to ensure it results in correct state
4. After undoing blocks, reconnect them to ensure they reconnect correctly
Parameter #2—the number of blocks to check
|Number Of Blocks||number (int)||Optional
(0 or 1)
|The number of blocks to verify. Set to
Verify the most recent 10,000 blocks in the most through way:
pai-cli -testnet verifychain 4 10000
Result (took 4 minutes and 25 seconds on a generic PC laptop; it would’ve taken much longer on mainnet):
GetBlockChainInfo: provides information about the current state of the block chain.
GetTxOutSetInfo: returns statistics about the confirmed unspent transaction output (UTXO) set. Note that this call may take some time and that it only counts outputs from confirmed transactions—it does not count outputs from the memory pool.