getblocktemplate - Litecoin
Example code for the getblocktemplate JSON-RPC method. Complete guide on how to use getblocktemplate JSON-RPC in GetBlock Web3 documentation.
Parameters
Parameter
Type
Description
Request
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "getblocktemplate",
"params": [{}],
"id": "getblock.io"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "getblocktemplate",
"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
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": {
"capabilities": ["proposal"],
"version": 536870912,
"rules": ["csv", "segwit", "mweb"],
"previousblockhash": "blockhash...",
"transactions": [],
"coinbaseaux": {},
"coinbasevalue": 625000000,
"target": "0000000000000...",
"mintime": 1640000000,
"mutable": ["time", "transactions", "prevblock"],
"noncerange": "00000000ffffffff",
"sigoplimit": 80000,
"sizelimit": 4000000,
"curtime": 1640000001,
"bits": "1a0fffff",
"height": 2750001
}
}Response Parameters
Field
Type
Description
Use Case
Error Handling
Status Code
Error Message
Cause
Integration Notes
Last updated
Was this helpful?