eth_getBlock

Returns information about the specified block.

Parameters

  • hash: (string) [Required] A string representing the hash (32 bytes) or number of a block.

  • transaction details flag: (boolean) [Required] If set to true, returns the full transaction objects, if false returns only the hashes of the transactions.

Returns

A block object matching the hash in the request, or null when no block was found. The matched block contains the following keys and their values:

  • difficulty: A hexadecimal of the difficulty for this block.

  • extraData: The "extra data" field of this block.

  • gasLimit: Maximum gas allowed in this block.

  • gasUsed: Total used gas by all transactions in this block.

  • hash: 32 bytes. The hash of the block. Null when the returned block is the pending block.

  • logsBloom: 256 bytes. The bloom filter for the logs of the block. Null when the returned block is the pending block.

  • miner: 20 bytes. The address of the beneficiary to whom the mining rewards were given.

  • nonce: 8 bytes. The hash of the generated proof-of-work. Null when the returned block is the pending block.

  • number: The block number. Null when the returned block is the pending block.

  • parentHash: 32 bytes. The hash of the parent block.

  • receiptsRoot: 32 bytes. The root of the receipts trie of the block.

  • sha3Uncles: 32 bytes. The SHA3 of the uncles data in the block.

  • size: A hexadecimal of the size of this block in bytes.

  • stateRoot: 32 bytes. The root of the final state trie of the block.

  • timestamp: Unix timestamp for when the block was collated.

  • totalDifficulty: A hexadecimal of the total difficulty of the chain until this block.

  • transactions: [Array] An array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter.

  • transactionsRoot: 32 bytes. The root of the transaction trie of the block.

  • uncles: [Array] An Array of uncle hashes.

Example

Request

curl https://rpc.testnet.tryradi.us/<YOUR-RPC-ENDPOINT> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '
{
  "jsonrpc": "2.0",
  "method": "eth_getBlock",
  "params": [
    "0x194b8d0d353",
    true
  ],
  "id": 1
}
'

Response

{
  "jsonrpc": "2.0",
  "result": {
    "hash": "0x00000000000000000000000000000000000000000000000000000194b8d0d353",
    "blockHash": "0x00000000000000000000000000000000000000000000000000000194b8d0d353",
    "parentHash": "0x00000000000000000000000000000000000000000000000000000194b8d0d352",
    "number": "0x194b8d0d353",
    "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "miner": "0x0000000000000000000000000000000000000000",
    "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "difficulty": "0x0",
    "gasLimit": "0x0000000000000000",
    "gasUsed": "0x0000000000000000",
    "timestamp": "0x0000000000000000",
    "totalDifficulty": "0x0000000000000000",
    "transactionHashes": [],
    "uncles": [],
    "extraData": [],
    "prevrandao": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "withdrawalsroot": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "baseFeePerGas": "0x0000000000000000",
    "blobGasUsed": "0x0000000000000000",
    "blobGasPrice": "0x0000000000000000",
    "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "nonce": "0x0000000000000000"
  },
  "id": 1
}

Last updated

Was this helpful?