getFirstAvailableBlock
The getFirstAvailableBlock method returns the slot number of the lowest confirmed block that has not been purged from the ledger. This method is essential for understanding the historical data availability window on a particular RPC node.
Solana validators don't store the complete blockchain history indefinitely due to storage constraints. Instead, they maintain a rolling window of recent blocks and periodically purge older ledger data to manage disk usage. The first available block represents the oldest slot for which you can still query full block data, transactions, and account state changes. This boundary varies by node depending on their ledger retention policies and available storage.
Knowing the first available block is crucial for applications that process historical data, implement block explorers, or need to determine whether specific historical queries will succeed. Archive nodes typically retain much more history than standard RPC nodes, while validator nodes may keep minimal history. This method helps you determine the practical limits of historical data access for your current RPC connection.
Parameters
parameter | type | description |
|---|---|---|
config | object | Optional configuration object (currently no config options are available) |
Return Object
field | type | description |
|---|---|---|
result | number | The slot number (u64) of the first available confirmed block |
Request Example
Response Example
Tip: Compare this value with the current slot (from getSlot) to determine how much history is available. Archive RPC nodes may have significantly lower values (more history) than standard nodes. Always check this before attempting to query historical blocks to avoid errors.