L0vdL0vd

erigon_getHeaderByNumber

Returns only the header of a block by number: lighter than eth_getBlockByNumber.

Архив · Работает на любом прошлом блоке

curl https://eth.l0vdinfra.com/YOUR_KEY \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1,"method":"erigon_getHeaderByNumber","params":[18908895]}'

Пример ответа

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "parentHash": "0x2757d9075d142237a41aa35e60e576b663d073674f7982205121a4ce168efbd1",
    "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    "miner": "0x8a6af67676694aa48acfe4798e23a80feee05bcb",
    "stateRoot": "0x481de57d7e78c6896b4501183ac291c832ac6e745570951dd98f9aaba46fd20a",
    "transactionsRoot": "0x573d7d540ff2489e962aa87c13ce32a1cfc59bbdf8a66d81b649bc0dfb9c1a46",
    "receiptsRoot": "0x9e3f198a9f6c139ac1a6187b2dd762c170bb275c61a0eb43eb534767fd2d9a08",
    "logsBloom": "0x0c2f4922c4a154388199420c8a08930a0c11cc41ec800604260dbb0e94725b33300509088ebf538013591f820cd0393d3a83d80abefcb5c30329013b04ad0510387a33cd49028bfa5d1c755e407d346aa4a8108ebc771c42368458acc3a789b37a915aa2…",
    "difficulty": "0x0",
    "number": "0x12086df",
    "gasLimit": "0x1c9c380",
    "gasUsed": "0xd0638d",
    "timestamp": "0x6592008b",
    "extraData": "0xd883010d05846765746888676f312e32312e35856c696e7578",
    "mixHash": "0x699eb6254783829743a754a5397be856bfab0febcdfdb1f529841de19204d981",
    "nonce": "0x0000000000000000",
    "baseFeePerGas": "0x2ea76811a",
    "withdrawalsRoot": "0x774fac51d1f9a5cf9483424536f7277d525d63d0e8b34246bb8126f02276bfd9",
    "blobGasUsed": null,
    "excessBlobGas": null,
    "parentBeaconBlockRoot": null,
    "requestsHash": null,
    "blockAccessListHash": null,
    "hash": "0x08f760c77e7a5843464404bf59d1f042a8b2ec18ae9345a16940546216069eec"
  }
}

Длинные массивы и hex-строки в примере сокращены.

Параметры и свой эндпоинт

Параметры

blockNumbernumberобязательный
Block number as a JSON number, e.g. 18908895.

Возвращает

object Block header.

numberstring
Block number, hex.
hashstring
Block hash.
parentHashstring
Hash of the parent block.
timestampstring
Unix timestamp, hex.
minerstring
Fee recipient address.
gasUsedstring
Total gas used by the block's transactions, hex.
gasLimitstring
Block gas limit, hex.
baseFeePerGasstring
EIP-1559 base fee, hex wei (London and later).
logsBloomstring
Bloom filter for the block's logs.
stateRootstring
Root of the state trie after the block.

Когда использовать

Read just the header (hash, parent, timestamp, roots, base fee) when you do not need transactions.

Как читать ответ

Header fields as in a block object, without the transactions list.

Советы

  • The block number is a plain JSON number here, not a hex string.

Связанные методы