Docs

eth_getBlockByHash - Moonbase RPC Method

Retrieve complete block data by block hash on Moonbase Alpha. Essential for Moonbeam developers, dApp testers, and teams validating cross-chain integrations building on the Moonbeam testnet for risk-free EVM dApp development and deployment testing.

Returns information about a block by hash on Moonbase Alpha.

Why Moonbase? Build on the Moonbeam testnet for risk-free EVM dApp development and deployment testing with free testnet tokens, full EVM compatibility, XCM testing capabilities, and identical feature set to Moonbeam mainnet.

Use Cases

The eth_getBlockByHash method is essential for:

  • Block verification - Verify block data using its unique hash
  • Chain reorganization handling - Track blocks during reorgs
  • Cross-chain bridges - Verify block finality for EVM dApp testing, XCM integration validation, and pre-mainnet deployment verification
  • Deterministic queries - Get consistent block data regardless of chain state

Code Examples

Error Handling

Error CodeMessageDescription
-32602Invalid paramsInvalid block hash format
-32000Block not foundBlock with this hash does not exist