GetBlockchainInfo

Returns an object containing various state info regarding blockchain processing.

Parameters

None

Returns

An object containing various state info regarding blockchain processing

chain: (string) current network name as defined in BIP70 (main, test, regtest)

blocks: (numeric) the current number of blocks processed in the server

headers: (numeric) the current number of headers we have validated

bestblockhash: (string) the hash of the currently best block

difficulty: (numeric) the current difficulty

mediantime: (numeric) median time for the current best block

verificationprogress: (numeric) estimate of verification progress [0..1]

initialblockdownload: (bool) (debug information) estimate of whether this node is in Initial Block Download mode.

chainwork: (string) total amount of work in active chain, in hexadecimal

size_on_disk: (numeric) the estimated size of the block and undo files on disk

pruned: xx, (boolean) if the blocks are subject to pruning

pruneheight: (numeric) lowest-height complete block stored (only present if pruning is enabled)

automatic_pruning: (boolean) whether automatic pruning is enabled (only present if pruning is enabled)

prune_target_size: (numeric) the target size used by pruning (only present if automatic pruning is enabled)

softforks: [ ... ] (array) status of softforks in progress

bip9_softforks: {...} (object) status of BIP9 softforks in progress

Example

//Request
curl -u user:password -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "getblockchaininfo","params": []}' http://<your-app-id>.ankr.com
//Response
{
"result":{
"chain":"main",
"blocks":1094028,
"headers":1301917,
"bestblockhash":"000000000000000f2ccffdff81c21e16ff845af479d58317899f451c750cb23c",
"difficulty":95232010.26899502,
"mediantime":1561621475,
"verificationprogress":0.6472761032918589,
"chainwork":"000000000000000000000000000000000000000000001743bedae37ee39def60",
"pruned":false,
"softforks":[
{
"id":"bip34",
"version":2,
"reject":{
"status":true
}
},
{
"id":"bip66",
"version":3,
"reject":{
"status":true
}
},
{
"id":"bip65",
"version":4,
"reject":{
"status":true
}
}
],
"bip9_softforks":{
"csv":{
"status":"active",
"startTime":1486252800,
"timeout":1517788800,
"since":622944
},
"dip0001":{
"status":"active",
"startTime":1508025600,
"timeout":1539561600,
"since":782208
},
"bip147":{
"status":"active",
"startTime":1524477600,
"timeout":1556013600,
"since":939456
},
"dip0003":{
"status":"active",
"startTime":1546300800,
"timeout":1577836800,
"since":1028160
},
"dip0008":{
"status":"active",
"startTime":1557878400,
"timeout":1589500800,
"since":1088640
}
}
},
"error":null,
"id":1
}