Skip to main content

eth_getBlockByHash

Gets a block for a given hash

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 author
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{40}$
  • baseFeePerGas baseFeePerGas
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • difficulty difficulty
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • extraData extraData
    type : string
    Pattern : ^0x[0-9a-f]*$
  • gasLimit gasLimit
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • gasUsed gasUsed
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • hash hash
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$
  • logsBloom logsBloom
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{512}$
  • miner miner
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{40}$
  • mixHash mixHash
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$
  • nonce nonce
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{16}$
  • number number
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • parentHash parentHash
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$
  • receiptsRoot receiptsRoot
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$
  • sha3uncle sha3uncle
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$
  • size size
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • stateRoot stateRoot
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$
  • timestamp timestamp
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • totalDifficulty totalDifficulty
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • transactions transactions
    oneOf
    type : array
    • items[x] H256
      type : string
      Pattern : ^0x[0-9,a-f,A-F]{64}$
  • transactionsRoot transactionsRoot
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$
  • uncles uncles
    type : array
    • items[x] H256
      type : string
      Pattern : ^0x[0-9,a-f,A-F]{64}$

Examples

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": []
}