Skip to content

getblockchaininfo JSON-RPC command

getblockchaininfo

Returns an object containing various state info regarding blockchain processing.

Result

{ "chain": "xxxx", (string) current network name as defined in BIP70 (main, test, regtest) "blocks": xxxxxx, (numeric) the current number of blocks processed in the server "headers": xxxxxx, (numeric) the current number of headers we have validated "bestblockhash": "...", (string) the hash of the currently best block "difficulty": xxxxxx, (numeric) the current difficulty "mediantime": xxxxxx, (numeric) median time for the current best block "verificationprogress": xxxx, (numeric) estimate of verification progress [0..1] "initialblockdownload": xxxx, (bool) (debug information) estimate of whether this node is in Initial Block Download mode. "chainwork": "xxxx" (string) total amount of work in active chain, in hexadecimal "size_on_disk": xxxxxx, (numeric) the estimated size of the block and undo files on disk "pruned": xx, (boolean) if the blocks are subject to pruning "pruneheight": xxxxxx, (numeric) lowest-height complete block stored (only present if pruning is enabled) "automatic_pruning": xx, (boolean) whether automatic pruning is enabled (only present if pruning is enabled) "prune_target_size": xxxxxx, (numeric) the target size used by pruning (only present if automatic pruning is enabled) "upgrade_status": { (json object) details about the next scheduled upgrade "name": "...", (string) human-readable upgrade name "mempool_activated": true|false, (boolean) whether the upgrade has activated for the mempool "mempool_activation_mtp": n, (numeric) mediantime for mempool upgrade activation "block_preactivation_height": n|null, (numeric or null) block height immediately before activation "block_preactivation_hash": "..."|null, (string or null) hash of the preactivation block "block_postactivation_height": n|null, (numeric or null) first height enforcing the upgrade "block_postactivation_hash": "..."|null, (string or null) hash of the postactivation block "software_expiration_time": n|null (numeric or null) UTC time for when this software build expires (null = expiration is disabled) }, "warnings" : "...", (string) any network and blockchain warnings. }

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/ ```


Bitcoin Cash Node Daemon version v29.0.1-71febb2

Documentation on docs.bitcoincashnode.org reflects the current master branch in Git, and may include API changes that are not yet present in the latest release.