getblockchaininfo - Litecoin
Example code for the getblockchaininfo JSON-RPC method. Complete guide on how to use getblockchaininfo JSON-RPC in GetBlock 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"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "getblockchaininfo",
"params": [],
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://go.getblock.io/<ACCESS-TOKEN>/',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));Response
{
"result": {
"chain": "main",
"blocks": 3050072,
"headers": 3050072,
"bestblockhash": "54b4e01920b72c4257d12cdc90cbee2732498568e9f8dfc23f0b758d22bf4afc",
"difficulty": 96475280.13079503,
"mediantime": 1770190296,
"verificationprogress": 0.9999997778976507,
"initialblockdownload": false,
"chainwork": "0000000000000000000000000000000000000000000029bac2285835177ecd5e",
"size_on_disk": 245266343141,
"pruned": false,
"softforks": {
"bip34": {
"type": "buried",
"active": true,
"height": 710000
},
"bip66": {
"type": "buried",
"active": true,
"height": 811879
},
"bip65": {
"type": "buried",
"active": true,
"height": 918684
},
"csv": {
"type": "buried",
"active": true,
"height": 1201536
},
"segwit": {
"type": "buried",
"active": true,
"height": 1201536
},
"taproot": {
"type": "bip8",
"bip8": {
"status": "active",
"start_height": 2161152,
"timeout_height": 2370816,
"since": 2257920
},
"height": 2257920,
"active": true
},
"mweb": {
"type": "bip8",
"bip8": {
"status": "active",
"start_height": 2217600,
"timeout_height": 2427264,
"since": 2265984
},
"height": 2265984,
"active": true
}
},
"warnings": ""
},
"error": null,
"id": "getblock.io"
}Response Parameters
Field
Type
Description
Use Case
Error Handling
Status Code
Error Message
Cause
Integration Notes
Last updated
Was this helpful?