Infura icon

Infura

Interact with blockchain APIs via Infura

Get Uncle By Block Number And Index

AI-generated

Overview

This node operation retrieves an uncle block from the Ethereum blockchain by specifying the block number and the uncle index. It is useful for blockchain developers or analysts who need to access details about uncle blocks, which are blocks that were mined but not included in the main blockchain, often used to improve blockchain security and decentralization.

Use Case Examples

  1. Retrieve uncle block details for block number '0x10d4f' and uncle index '0x0' to analyze uncle blocks in a specific block.
  2. Use the operation to monitor uncle blocks for blockchain research or auditing purposes.

Properties

Name Meaning
Block Number The block number (in hex) or tag (latest, earliest, pending) to identify the block containing the uncle.
Uncle Index The index (in hex) of the uncle block within the specified block.

Output

JSON

  • blockNumberDecimal - Decimal representation of the uncle block number.
  • timestampDate - Timestamp of the uncle block in ISO 8601 date format.
  • gasLimitDecimal - Decimal representation of the gas limit of the uncle block.
  • gasUsedDecimal - Decimal representation of the gas used in the uncle block.
  • number - Hexadecimal block number of the uncle block.
  • timestamp - Hexadecimal timestamp of the uncle block.
  • gasLimit - Hexadecimal gas limit of the uncle block.
  • gasUsed - Hexadecimal gas used in the uncle block.

Dependencies

  • Infura API key credential with project ID and network configuration

Troubleshooting

  • Ensure the block number and uncle index are provided in the correct hexadecimal format or valid tags (latest, earliest, pending).
  • If the node returns an error about unknown operation, verify that the operation name is correctly set to 'getUncleByBlockNumberAndIndex'.
  • Check that the Infura API credentials are correctly configured and have access to the specified network.
  • If the uncle block is not found, verify that the block number and uncle index correspond to an existing uncle block in the blockchain.

Links

Discussion