get_fork_block - Nervos

Returns the information about a fork block by hash.

Parameters

  • block_hash - The fork block hash.
  • verbosity - Result format which allows 0 and 2. (Optional, the default is 2.)

Returns

The RPC returns a fork block or null. When the RPC returns a block, the block hash must equal to the parameter block_hash.

Please note that due to the technical nature of the peer to peer sync, the RPC may return null or a fork block result on different nodes with same block_hash even they are fully synced to the canonical chain. And because of chain reorganization, for the same block_hash, the RPC may sometimes return null and sometimes return the fork block.

When verbosity is 2, it returns a JSON object as the result. See BlockView for the schema.

When verbosity is 0, it returns a 0x-prefixed hex string as the result. The string encodes the block serialized by molecule using schema table Block.

Example

Request

curl --location --request POST 'https://ckb-mirana.unifra.io/v1/4fb36720a57340d39aee4cf68511064a' \
--header 'Content-Type: application/json' \
--data-raw '{
  "id": 42,
  "jsonrpc": "2.0",
  "method": "get_fork_block",
  "params": [
    "0xb3c5b9789dff3821e298a62e6cc4060accb19ed2558f988a8826573252b9ae20"
  ]
}'

Result

{
    "jsonrpc": "2.0",
    "result": null,
    "id": 42
}
Language
Click Try It! to start a request and see the response here!