curl --request POST \
--url https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8 \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "1.0",
"method": "getblocktemplate",
"params": [
{
"mode": "template",
"capabilities": [
"coinbasetxn",
"workid",
"coinbase/append"
],
"rules": [
"segwit"
]
}
],
"id": 1
}'
{
"result": {},
"error": {},
"id": 123
}
curl --request POST \
--url https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8 \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "1.0",
"method": "getblocktemplate",
"params": [
{
"mode": "template",
"capabilities": [
"coinbasetxn",
"workid",
"coinbase/append"
],
"rules": [
"segwit"
]
}
],
"id": 1
}'
{
"result": {},
"error": {},
"id": 123
}
getblocktemplate
method is used by miners to request a block template for mining new blocks. It can be customized with various parameters to specify the desired mining capabilities and rules.
mode
(optional): Specifies the mode of operation. Can be ‘template’ for a block template or ‘proposal’ for submitting a block proposal. This field is required if parameters are specified.capabilities
(optional): A list of strings specifying the capabilities the miner supports. This can include ‘coinbasetxn’, ‘workid’, ‘coinbase/append’, etc.rules
(optional): A list of strings specifying the rules the miner will support. For example, ‘segwit’ indicates support for Segregated Witness.result
— an object containing the block template or proposal for mining.error
— an object containing an error message if an error occurred, otherwise null
.id
— an integer representing the ID of the request.getblocktemplate
method is crucial for miners who need to get information about the current state of the network to mine new blocks. It allows miners to get a template for creating a new block to be added to the blockchain.A block template or proposal for mining.
The response is of type object
.
Was this page helpful?