How to fetch historical blocks on Solana
Access archival data to retrieve any block from Solana history. See what the genesis block looked like and explore the earliest moments of the network.
Why is archival data rare?
Most Solana RPC nodes only store recent data (last few days). Archival nodes store the complete blockchain history since genesis, but they require significant storage and are expensive to run. Helius provides archival access so you can query any historical slot.
Interactive Demo
Enter any slot number or use the quick select buttons to explore historical blocks. Try slot 0 to see the genesis block.
Copy the code
These snippets show how to fetch historical blocks. Paste them into your project.
1. Fetch any block by slot
Use getBlock with a slot number to retrieve block data including transactions and rewards.
// Fetch a historical block by slot number
// Requires Helius archival access for old blocks
import { createSolanaRpc } from '@solana/kit';
const rpc = createSolanaRpc('https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY');
// Fetch the genesis block (slot 0)
const genesisBlock = await rpc.getBlock(0, {
encoding: 'jsonParsed',
transactionDetails: 'signatures',
maxSupportedTransactionVersion: 0,
rewards: true,
}).send();
if (genesisBlock) {
console.log('Blockhash:', genesisBlock.blockhash);
console.log('Block Time:', genesisBlock.blockTime);
console.log('Block Height:', genesisBlock.blockHeight);
console.log('Transactions:', genesisBlock.transactions.length);
console.log('Parent Slot:', genesisBlock.parentSlot);
} else {
console.log('Block not found (slot may have been skipped)');
}2. Get block with full transaction details
Set transactionDetails: "full" to get complete transaction data with parsed instructions.
// Fetch block with full transaction details
import { createSolanaRpc } from '@solana/kit';
const rpc = createSolanaRpc('https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY');
const block = await rpc.getBlock(slot, {
encoding: 'jsonParsed',
transactionDetails: 'full', // Get full transaction data
maxSupportedTransactionVersion: 0,
rewards: true,
}).send();
if (block) {
// Access full transaction details
for (const tx of block.transactions) {
console.log('Signature:', tx.transaction.signatures[0]);
console.log('Success:', tx.meta?.err === null);
console.log('Fee:', tx.meta?.fee);
// Parsed instructions (when available)
const instructions = tx.transaction.message.instructions;
console.log('Instructions:', instructions.length);
}
}API Notes
- Archival access required: Historical blocks older than a few days need archival RPC nodes. Helius includes archival access on all plans.
- Skipped slots: Not every slot has a block. Validators may skip slots, returning null. Try nearby slots if one is missing.
- transactionDetails options: Use "signatures" for speed, "full" for complete data, or "none" for just block metadata.
- Block time: Very early blocks may have null blockTime as this field was added later.
About the Genesis Block
- Solana mainnet launched on March 16, 2020 with the genesis block at slot 0.
- The genesis block contains initial validator configurations and system accounts.
- Unlike Bitcoin, Solana does not have a coinbase message in its genesis block.
- Early Solana blocks are historically significant for researchers and archivists.