btg

BTG

POST

GET

chevron-right

Last updated on January 1, 1970

3 min read

Method getblocktemplate undefined ()
connect with JSON-RPC protocol

getblocktemplate

info-circle-fill

If the request parameters include a ‘mode’ key, that is used toexplicitly select between the default ‘template’ request or a‘proposal’.It returns data needed to construct a block to work on.

Parameters

template_request - json object, optional, default={}

Format of the template

Request

curl --location --request POST 'https://btg.getblock.io/mainnet' 
--header 'x-api-key: YOUR-API-KEY' 
--header 'Content-Type: application/json' 
--data-raw '{"jsonrpc": "2.0",
"method": "getblocktemplate",
"params": [null],
"id": "getblock.io"}'

Response

{
    "error": null,
    "id": "getblock.io",
    "result": {
        "bits": "1d0287ff",
        "capabilities": [
            "proposal"
        ],
        "coinbaseaux": {
            "flags": ""
        },
        "coinbasevalue": 625000000,
        "curtime": 1631009575,
        "equihashk": 5,
        "equihashn": 144,
        "height": 702635,
        "longpollid": "000000007cc1fc836d0992202730ca71f77a8cf2a35974ca300dadbf8bc1e0902",
        "mintime": 1631008652,
        "mutable": [
            "time",
            "transactions",
            "prevblock"
        ],
        "noncerange": "00000000ffffffff",
        "previousblockhash": "000000007cc1fc836d0992202730ca71f77a8cf2a35974ca300dadbf8bc1e090",
        "rules": [
            "csv",
            "segwit"
        ],
        "sigoplimit": 80000,
        "sizelimit": 4000000,
        "target": "0000000287ff0000000000000000000000000000000000000000000000000000",
        "transactions": [],
        "vbavailable": {},
        "vbrequired": 0,
        "version": 536870912,
        "weightlimit": 4000000
    }
}
banner icon

Start Building with GetBlock RPCs for Free