Docs

eth_getBlockByNumber - Astar RPC Method

Retrieve complete block data by block number on Astar. Perfect for multi-chain dApp developers, DeFi builders, and teams leveraging Polkadot + Ethereum ecosystems building on Polkadot's leading dApp hub supporting EVM, WASM, and upcoming PolkaVM environments.

Returns information about a block by block number on Astar.

Why Astar? Build on Polkadot's leading dApp hub supporting EVM, WASM, and upcoming PolkaVM environments with EVM + WASM + PolkaVM support, Build2Earn developer rewards, dApp Staking, and Soneium cross-layer integration.

Use Cases

The eth_getBlockByNumber method is essential for:

  • Block explorers - Display complete block information
  • Transaction indexers - Process all transactions in a block
  • Analytics platforms - Analyze blockchain data for cross-chain DeFi, multi-VM smart contracts, and XCM-enabled interoperability with Ethereum and Cosmos
  • Timestamp verification - Get block timestamps for time-based logic

Code Examples

Error Handling

Error CodeMessageDescription
-32602Invalid paramsInvalid block number or parameter format
-32000Block not foundBlock does not exist