minimumLedgerSlot

Learn minimumLedgerSlot use cases, code examples, request parameters, response structure, and tips.

The minimumLedgerSlot RPC method in CoinVera returns the oldest slot for which the queried RPC node retains ledger data. This is especially useful for determining whether a node can serve historical queries, such as old transactions or block information.


✅ Common Use Cases

  • Determine Historical Data Availability Before querying for old transaction or block data, check if the node retains the slot you're interested in.

  • Understand Node Pruning Behavior Identify how much historical data the node stores—important when working with non-archival nodes that prune older slots.

  • Coordinate Historical Data Indexing Use this to set bounds for data-fetching services or APIs that sync and process Solana history.


🧾 Request Parameters

This method does not take any parameters.

[]

📦 Response Structure

Returns a single numeric value representing the lowest slot retained by the node:

{
  "jsonrpc": "2.0",
  "result": 108938444,
  "id": 1
}
  • result: The earliest slot this node can potentially serve data from.


🧪 Example

Get the Oldest Available Slot from an RPC Node

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "minimumLedgerSlot"
}

Code Examples

const fetch = require('node-fetch');

async function minimumLedgerSlot(rpcUrl) {
  try {
    const response = await fetch(rpcUrl, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        jsonrpc: '2.0',
        id: 1,
        method: 'minimumLedgerSlot'
      }),
    });

    const data = await response.json();
    
    // Print the exact full response
    console.log('Full RPC Response:');
    console.log(JSON.stringify(data, null, 2));
    
    return data;
  } catch (error) {
    console.error('Error getting health:', error.message);
    return null;
  }
}

// Example usage
const RPC_URL = 'https://rpc.coinvera.io/?x-api-key=your-coinvera-x-api-key';

minimumLedgerSlot(RPC_URL);

Example Response

{
  "jsonrpc": "2.0",
  "result": 355355858,
  "id": 1
}

💡 Developer Tips

  • Node-Specific Result Each RPC node may retain a different portion of the ledger, depending on its configuration and whether it's archival.

  • Value Increases Over Time The minimum ledger slot can only increase as older data is pruned. It never decreases.

  • Not a Guarantee of Continuity The presence of a minimum slot does not mean all slots after it are available—gaps may exist.

  • Use Archival Nodes for Full History If you need complete historical data from genesis, query an archival node, as standard RPC nodes may not store full ledger history.


The minimumLedgerSlot method provides a reliable way to verify a node’s historical data retention range, helping you decide whether it's suitable for deep history queries or whether you need to switch to a full archival provider like CoinVera.

Last updated