Infura icon

Infura

Interact with blockchain APIs via Infura

Get Uncle By Block Hash And Index

AI-generated

Overview

This node operation retrieves an uncle block from the Ethereum blockchain using a specific block hash and uncle index. It is useful for blockchain analysis, debugging, or monitoring uncle blocks (blocks that were mined but not included in the main chain) related to a particular block hash. For example, a user can input a block hash and an uncle index to get detailed information about that uncle block, including its number, timestamp, gas limits, and usage.

Use Case Examples

  1. Retrieve uncle block details by providing a block hash and uncle index to analyze blockchain forks or uncle blocks.
  2. Monitor uncle blocks for a specific block hash to understand network conditions or mining activity.

Properties

Name Meaning
Block Hash Hash of the block to retrieve the uncle from.
Uncle Index Index of the uncle block in hexadecimal format.

Output

JSON

  • blockNumberDecimal - Decimal representation of the uncle block number.
  • timestampDate - Timestamp of the uncle block as an ISO string.
  • gasLimitDecimal - Gas limit of the uncle block in decimal.
  • gasUsedDecimal - Gas used by the uncle block in decimal.
  • number - Original uncle block number in hex.
  • timestamp - Original uncle block timestamp in hex.
  • gasLimit - Original gas limit in hex.
  • gasUsed - Original gas used in hex.

Dependencies

  • Infura API key credential with project ID and optional project secret for authentication.

Troubleshooting

  • Ensure the block hash and uncle index are correctly formatted as hexadecimal strings.
  • If the node throws an 'Unknown operation' error, verify that the operation name is correctly set to 'getUncleByBlockHashAndIndex'.
  • Check network connectivity and Infura API credentials if requests fail or return errors.

Discussion