getblockchaininfo - Zcash
Example code for the getblockchaininfo JSON-RPC method. Сomplete guide on how to use the getblockchaininfo JSON-RPC method in GetBlock.io Web3 documentation.
Parameters
Request
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "getblockchaininfo",
"params": [],
"id": "getblock.io"
}'const axios = require('axios');
const response = await axios.post('https://go.getblock.io/<ACCESS-TOKEN>/', {
jsonrpc: '2.0',
method: 'getblockchaininfo',
params: [],
id: 'getblock.io'
}, {
headers: { 'Content-Type': 'application/json' }
});
console.log(response.data.result);import requests
response = requests.post(
'https://go.getblock.io/<ACCESS-TOKEN>/',
headers={'Content-Type': 'application/json'},
json={
'jsonrpc': '2.0',
'method': 'getblockchaininfo',
'params': [],
'id': 'getblock.io'
}
)
print(response.json())Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": {
"chain": "main",
"blocks": 3420501,
"headers": 3420501,
"difficulty": 228671456.48084024,
"verificationprogress": 1.0,
"chainwork": 0,
"pruned": false,
"size_on_disk": 275502566707,
"commitments": 0,
"bestblockhash": "0000000000702274467e0acbc3420999a97cf6f8f9c579651e74cf850056a285",
"estimatedheight": 3420501,
"chainSupply": {
"chainValue": 16834165.7905448,
"chainValueZat": 1683416579054480,
"monitored": true
},
"valuePools": [
{
"id": "transparent",
"chainValue": 12381989.41404258,
"chainValueZat": 1238198941404258,
"monitored": true
},
{
"id": "sprout",
"chainValue": 25409.41766914,
"chainValueZat": 2540941766914,
"monitored": true
},
{
"id": "sapling",
"chainValue": 590908.08661313,
"chainValueZat": 59090808661313,
"monitored": true
},
{
"id": "orchard",
"chainValue": 3784464.74721995,
"chainValueZat": 378446474721995,
"monitored": true
},
{
"id": "lockbox",
"chainValue": 51394.125,
"chainValueZat": 5139412500000,
"monitored": true
},
{
"id": "ironwood",
"chainValue": 0.0,
"chainValueZat": 0,
"monitored": false
}
],
"upgrades": {
"5ba81b19": {
"name": "Overwinter",
"activationheight": 347500,
"status": "active"
},
"76b809bb": {
"name": "Sapling",
"activationheight": 419200,
"status": "active"
},
"2bb40e60": {
"name": "Blossom",
"activationheight": 653600,
"status": "active"
},
"f5b9230b": {
"name": "Heartwood",
"activationheight": 903000,
"status": "active"
},
"e9ff75a6": {
"name": "Canopy",
"activationheight": 1046400,
"status": "active"
},
"c2d6d0b4": {
"name": "NU5",
"activationheight": 1687104,
"status": "active"
},
"c8e71055": {
"name": "NU6",
"activationheight": 2726400,
"status": "active"
},
"4dec4df0": {
"name": "NU6.1",
"activationheight": 3146400,
"status": "active"
},
"5437f330": {
"name": "NU6.2",
"activationheight": 3364600,
"status": "active"
},
"37a5165b": {
"name": "NU6.3",
"activationheight": 3428143,
"status": "pending"
}
},
"consensus": {
"chaintip": "5437f330",
"nextblock": "5437f330"
}
}
}Response Parameters
Parameter
Type
Description
Use Cases
Error Handling
Error Code
Message
Description
Last updated
Was this helpful?