⚡ Test Our Private Nodes of 40+ Blockchains just for $50!

coins coins coins coins
/

Nervos Network (CKB)

ckb
Nervos Network (CKB)

Method: POST generate_block_with_template

dropdown

# generate_block_with_template example for Nervos Network (CKB)

POST generate_block_with_template

Method not allowed

Generate block with block template, attach calculated dao field to build new block, then process block and broadcast the block.

Parameters

block_template - blockTemplate

specified transaction to add, in format:

- version - block version (0 by now)
- compact_target - (uint32) The compacted difficulty target for the new block.
- current_time - The timestamp for the new block.
- number - (64-bit unsigned integer) The block number for the new block.
- epoch - (64-bit unsigned integer) The epoch progress information for the new block.
- parent_hash - (h256) The parent block hash of the new block.
- cycles_limit - (h256) The cycles limit. Miners must keep the total cycles below this limit, otherwise, the CKB node will reject the block submission.
- bytes_limit - (uint64) The block serialized size limit. Miners must keep the block size below this limit, otherwise, the CKB node will reject the block submission.
- uncles_count_limit - (uint64) The uncle count limit. Miners must keep the uncles count below this limit, otherwise, the CKB node will reject the block submission.
- uncles - (array of uncleTemplate) Provided valid uncle blocks candidates for the new block. Miners must include the uncles marked as required in the assembled new block.
- transactions - (array of TransactionTemplate) Provided valid transactions which can be committed in the new block.
- proposals - (array of ProposalShortId) Provided proposal ids list of transactions for the new block.
- cellbane - (cellbaseTemplate) Provided cellbase transaction template. Miners must use it as the cellbase transaction without changes in the assembled block.
- work_id - (uint64) Work ID. The miner must submit the new assembled and resolved block using the same work ID.
- dao - (byte32) Reference DAO field. This field is only valid when miners use all and only use the provided transactions in the template.
- extension - (jsonBytes) The extension for the new block. This field is optional. It’s a reserved field, please leave it blank.

Request

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


Response

{
    "result": "null",
    "id": "getblock.io",
    "status_code": 405,
    "message": "Method not allowed"
}