getblockchaininfo

v0.9.4

getblockchaininfo
Returns an object containing various state info regarding block chain processing.

Result:
{
"chain": "xxxx", (string) current chain (main, testnet3, regtest)
"blocks": xxxxxx, (numeric) the current number of blocks processed in the server
"bestblockhash": "...", (string) the hash of the currently best block
"difficulty": xxxxxx, (numeric) the current difficulty
"verificationprogress": xxxx, (numeric) estimate of verification progress [0..1]
"chainwork": "xxxx" (string) total amount of work in active chain, in hexadecimal
}

Examples:
> bitcoin-cli getblockchaininfo
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
Don't trust. Verify. Docs extracted from src/rpcblockchain.cpp#L434-L452.