eth_getBlockByHash
Gets a block for a given hash
- CURL
curl --request POST \
     --url https://evm.confluxrpc.com \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "id": 1,
  "jsonrpc": "2.0",
  "params": ["0x1768f524493543ac12785a8dd50e5a5b2c5b1ebaaef4f6202a5832783fad13bc",false],
  "method": "eth_getBlockByHash"
}'
Params
blockHash required
Schema
type : string
Pattern : 
^0x[0-9,a-f,A-F]{64}$includeTransactions required
Schema
type : boolean
Result
Block representation
type : object
- author authortype : stringPattern :- ^0x[0-9,a-f,A-F]{40}$
- baseFeePerGas baseFeePerGastype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- difficulty difficultytype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- extraData extraDatatype : stringPattern :- ^0x[0-9a-f]*$
- gasLimit gasLimittype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- gasUsed gasUsedtype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- hash hashtype : stringPattern :- ^0x[0-9,a-f,A-F]{64}$
- logsBloom logsBloomtype : stringPattern :- ^0x[0-9,a-f,A-F]{512}$
- miner minertype : stringPattern :- ^0x[0-9,a-f,A-F]{40}$
- mixHash mixHashtype : stringPattern :- ^0x[0-9,a-f,A-F]{64}$
- nonce noncetype : stringPattern :- ^0x[0-9,a-f,A-F]{16}$
- number numbertype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- parentHash parentHashtype : stringPattern :- ^0x[0-9,a-f,A-F]{64}$
- receiptsRoot receiptsRoottype : stringPattern :- ^0x[0-9,a-f,A-F]{64}$
- sha3uncle sha3uncletype : stringPattern :- ^0x[0-9,a-f,A-F]{64}$
- size sizetype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- stateRoot stateRoottype : stringPattern :- ^0x[0-9,a-f,A-F]{64}$
- timestamp timestamptype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- totalDifficulty totalDifficultytype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- transactions transactionsoneOf- (H256,...)[]
- (Transaction,...)[]
 type : array- items[x]H256type : stringPattern :- ^0x[0-9,a-f,A-F]{64}$
 type : array- items[x]Transactiontype : object- accessList accessListtype : array- items[x]AccessListItemtype : object- address addresstype : stringPattern :- ^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
- storageKeys storageKeystype : array- items[x]H256type : stringPattern :- ^0x[0-9,a-f,A-F]{64}$
 
 
 
- blockHash blockHashtype : stringPattern :- ^0x[0-9,a-f,A-F]{64}$
- blockNumber blockNumbertype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- chainId chainIdtype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,15}|0)$
- creates createstype : stringPattern :- ^0x[0-9,a-f,A-F]{40}$
- from fromtype : stringPattern :- ^0x[0-9,a-f,A-F]{40}$
- gas gastype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- gasPrice gasPricetype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- hash hashtype : stringPattern :- ^0x[0-9,a-f,A-F]{64}$
- input inputtype : stringPattern :- ^0x[0-9a-f]*$
- maxFeePerGas maxFeePerGastype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- maxPriorityFeePerGas maxPriorityFeePerGastype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- nonce noncetype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- publicKey publicKeytype : stringPattern :- ^0x[0-9,a-f,A-F]{128}$
- r rtype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- raw rawtype : stringPattern :- ^0x[0-9a-f]*$
- s stype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- standardV standardVtype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- status statustype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,15}|0)$
- to totype : stringPattern :- ^0x[0-9,a-f,A-F]{40}$
- transactionIndex transactionIndextype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- transactionType transactionTypetype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,15}|0)$
- v vtype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- value valuetype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- yParity yParitytype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,15}|0)$
 
 
- transactionsRoot transactionsRoottype : stringPattern :- ^0x[0-9,a-f,A-F]{64}$
- uncles unclestype : array- items[x]H256type : stringPattern :- ^0x[0-9,a-f,A-F]{64}$
 
Examples
- eth_getBlockByHash
- eth_getBlockByHash
- eth_getBlockByHash
- eth_getBlockByHash
Request
curl -X POST --data \
'{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_getBlockByHash",
    "params": [
        "0x1768f524493543ac12785a8dd50e5a5b2c5b1ebaaef4f6202a5832783fad13bc"
    ]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
  "author": "0x12794484b0a6b0f1fcee72b29d322e93e9de5aac",
  "difficulty": "0x307fa8e",
  "extraData": "0x",
  "gasLimit": "0x1c9c380",
  "gasUsed": "0xcee2a",
  "hash": "0x1768f524493543ac12785a8dd50e5a5b2c5b1ebaaef4f6202a5832783fad13bc",
  "logsBloom": "0x0020000000040000000000008000000000000002004000000000004200000000000000000000000000000000000000000000000000000400000000000080000000000040400400000000000800100020000000200000000880000000808054000000000000000800000000000000080000000000001000000000001000000000000000000000000000001000c000000000000001008000080000044000404000000000800000000000000000000000000000014100000000000000000001000000000002400000020080000000000000200100002000001000008000000000000000000000000000400020000000000800000002800800400000000000001000",
  "miner": "0x12794484b0a6b0f1fcee72b29d322e93e9de5aac",
  "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "nonce": "0x000000000007b23f",
  "number": "0x43543a1",
  "parentHash": "0x5d7eaaa76573015a54aee6488eb13d8ec00bc6f4bc3089dfb88794ca7f39483d",
  "receiptsRoot": "0x01f0410ef63f4ccf82b01199c9474a155b94bba110c70bdd057d4e6c8ed81b76",
  "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  "size": "0x30d",
  "stateRoot": "0xf4053634693102b431dce144d09bc98d1a2c55fe9d7a3aac07b635598ae65fc9",
  "timestamp": "0x624e8191",
  "totalDifficulty": "0x0",
  "transactions": [
    "0x1bbc639c7dd00b9a09e51b606137be180c7812c8a752aa90d89fb6b22ef45807",
    "0x142febc57ab34e731da29cd68f5330f54311ddab11827ca4a0734ff219548602",
    "0xb0312f4972128d4bfee5162ee10cdbea6d0252c337db0c88fed6ce4c16ce8008"
  ],
  "transactionsRoot": "0x88f46d2a970b199cf94bb9fe88f5cc0cb52dffa66e5c6a4ac6b6eeda51b69d53",
  "uncles": []
}
Request
curl -X POST --data \
'{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_getBlockByHash",
    "params": [
        "0x1768f524493543ac12785a8dd50e5a5b2c5b1ebaaef4f6202a5832783fad13bc",
        true
    ]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
  "author": "0x12794484b0a6b0f1fcee72b29d322e93e9de5aac",
  "difficulty": "0x307fa8e",
  "extraData": "0x",
  "gasLimit": "0x1c9c380",
  "gasUsed": "0xcee2a",
  "hash": "0x1768f524493543ac12785a8dd50e5a5b2c5b1ebaaef4f6202a5832783fad13bc",
  "logsBloom": "0x0020000000040000000000008000000000000002004000000000004200000000000000000000000000000000000000000000000000000400000000000080000000000040400400000000000800100020000000200000000880000000808054000000000000000800000000000000080000000000001000000000001000000000000000000000000000001000c000000000000001008000080000044000404000000000800000000000000000000000000000014100000000000000000001000000000002400000020080000000000000200100002000001000008000000000000000000000000000400020000000000800000002800800400000000000001000",
  "miner": "0x12794484b0a6b0f1fcee72b29d322e93e9de5aac",
  "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "nonce": "0x000000000007b23f",
  "number": "0x43543a1",
  "parentHash": "0x5d7eaaa76573015a54aee6488eb13d8ec00bc6f4bc3089dfb88794ca7f39483d",
  "receiptsRoot": "0x01f0410ef63f4ccf82b01199c9474a155b94bba110c70bdd057d4e6c8ed81b76",
  "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  "size": "0x30d",
  "stateRoot": "0xf4053634693102b431dce144d09bc98d1a2c55fe9d7a3aac07b635598ae65fc9",
  "timestamp": "0x624e8191",
  "totalDifficulty": "0x0",
  "transactions": [
    {
      "blockHash": "0x1768f524493543ac12785a8dd50e5a5b2c5b1ebaaef4f6202a5832783fad13bc",
      "blockNumber": "0x43543a1",
      "chainId": "0x47",
      "creates": null,
      "from": "0x6bc6e87998fdb681afa45c4c4abbd0a1091684d8",
      "gas": "0x51615",
      "gasPrice": "0x1",
      "hash": "0x1bbc639c7dd00b9a09e51b606137be180c7812c8a752aa90d89fb6b22ef45807",
      "input": "0x7ff36ab5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000006bc6e87998fdb681afa45c4c4abbd0a1091684d800000000000000000000000000000000000000000000000000000000624e82b900000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ed3dddae5b2f321af0806181fbfa6d049be47d80000000000000000000000007d682e65efc5c13bf4e394b8f376c48e6bae0355",
      "nonce": "0x1",
      "publicKey": "0x1b115c131ad6acb6f88afd3403549eb2178b77998ac7029dd6f6e3d976c7466d1407cf9b7c8feb7422b5b106fb8d301c08887b6fa25bfc4acff79c4c485064fe",
      "r": "0x8f59561733353ec50b1174e7f8cae8d52575619f642677ee749de205dee55990",
      "raw": "0xf9014d01018305161594873789aaf553fd0b4252d0d2b72c6331c47aff2e888ac7230489e80000b8e47ff36ab5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000006bc6e87998fdb681afa45c4c4abbd0a1091684d800000000000000000000000000000000000000000000000000000000624e82b900000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ed3dddae5b2f321af0806181fbfa6d049be47d80000000000000000000000007d682e65efc5c13bf4e394b8f376c48e6bae035581b2a08f59561733353ec50b1174e7f8cae8d52575619f642677ee749de205dee559909f71a98449773de4c42bf6f1e50f40ec6c736c2eb6196229eb28f9312e6657a0",
      "s": "0x71a98449773de4c42bf6f1e50f40ec6c736c2eb6196229eb28f9312e6657a0",
      "standardV": "0x1",
      "status": "0x1",
      "to": "0x873789aaf553fd0b4252d0d2b72c6331c47aff2e",
      "transactionIndex": "0x0",
      "v": "0xb2",
      "value": "0x8ac7230489e80000"
    },
    {
      "blockHash": "0x1768f524493543ac12785a8dd50e5a5b2c5b1ebaaef4f6202a5832783fad13bc",
      "blockNumber": "0x43543a1",
      "chainId": "0x47",
      "creates": null,
      "from": "0x548f383c9946dbc8d35dd431ee914acab84b8ff3",
      "gas": "0x51615",
      "gasPrice": "0x1",
      "hash": "0x142febc57ab34e731da29cd68f5330f54311ddab11827ca4a0734ff219548602",
      "input": "0x7ff36ab500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000548f383c9946dbc8d35dd431ee914acab84b8ff300000000000000000000000000000000000000000000000000000000624e82ba00000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ed3dddae5b2f321af0806181fbfa6d049be47d800000000000000000000000049916ba65d0048c4bbb0a786a527d98d10a1cd2d",
      "nonce": "0x0",
      "publicKey": "0x0f711235c303b20f789978e765df5e5d73f629c5caa3c06ee1145ff817d45070ce7e413037d0353f6863e4c1336e9ea15b4aefcea8b1619660516bf9e30cdb49",
      "r": "0x6a479fd459f97744d4c9ed2ac52d4e3206fe5bcc07b30c582eb1395a6fde1db",
      "raw": "0xf9014e80018305161594873789aaf553fd0b4252d0d2b72c6331c47aff2e888ac7230489e80000b8e47ff36ab500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000548f383c9946dbc8d35dd431ee914acab84b8ff300000000000000000000000000000000000000000000000000000000624e82ba00000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ed3dddae5b2f321af0806181fbfa6d049be47d800000000000000000000000049916ba65d0048c4bbb0a786a527d98d10a1cd2d81b2a006a479fd459f97744d4c9ed2ac52d4e3206fe5bcc07b30c582eb1395a6fde1dba0430087fce1bf8acde94419f1b0b27a5227668fc8b3076758734b150919cf94a9",
      "s": "0x430087fce1bf8acde94419f1b0b27a5227668fc8b3076758734b150919cf94a9",
      "standardV": "0x1",
      "status": "0x1",
      "to": "0x873789aaf553fd0b4252d0d2b72c6331c47aff2e",
      "transactionIndex": "0x1",
      "v": "0xb2",
      "value": "0x8ac7230489e80000"
    },
    {
      "blockHash": "0x1768f524493543ac12785a8dd50e5a5b2c5b1ebaaef4f6202a5832783fad13bc",
      "blockNumber": "0x43543a1",
      "chainId": "0x47",
      "creates": null,
      "from": "0x8d86bc475bedcb08179c5e6a4d494ebd3b44ea8b",
      "gas": "0x64da4",
      "gasPrice": "0x1",
      "hash": "0xb0312f4972128d4bfee5162ee10cdbea6d0252c337db0c88fed6ce4c16ce8008",
      "input": "0x9c312cfd",
      "nonce": "0x813",
      "publicKey": "0x12ad2589e15771fdefad4491915ecc2d895bd7b81a4bb12d136e2075ebe47e84e9cc1d223520a18dd32cddfd8dad8d22204c117f77e26dec4b83807fb123d681",
      "r": "0x445441721c00b8404e5e599d50db2f37ff18912ac7066f7a2e0a25d67bc8cca9",
      "raw": "0xf86a8208130183064da494e4cff55f193b3493f1aa6811738309b2acf6c96383036ee8849c312cfd81b1a0445441721c00b8404e5e599d50db2f37ff18912ac7066f7a2e0a25d67bc8cca9a0567d39820042e94bb3d469a37edc98c70578cc76447b90f8a3e0076509d4bc30",
      "s": "0x567d39820042e94bb3d469a37edc98c70578cc76447b90f8a3e0076509d4bc30",
      "standardV": "0x0",
      "status": "0x1",
      "to": "0xe4cff55f193b3493f1aa6811738309b2acf6c963",
      "transactionIndex": "0x2",
      "v": "0xb1",
      "value": "0x36ee8"
    }
  ],
  "transactionsRoot": "0x88f46d2a970b199cf94bb9fe88f5cc0cb52dffa66e5c6a4ac6b6eeda51b69d53",
  "uncles": []
}
Request
curl -X POST --data \
'{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_getBlockByHash",
    "params": [
        "0x0000000000000000000000000000000000000000000000000000000000000000"
    ]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
null
Request
curl -X POST --data \
'{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_getBlockByHash",
    "params": [
        "0x0000000000000000000000000000000000000000000000000000000000000000",
        true
    ]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
null