minimumLedgerSlot - Solana

This method returns the lowest slot still present in the node's local ledger. The value increases over time as the node purges older slots.

Parameters

This method does not accept any parameters.

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "minimumLedgerSlot",
    "params": [],
    "id": "getblock.io"
}'

example.js

javascriptconst { Connection } = require('@solana/web3.js');

const connection = new Connection('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', 'confirmed');

const minSlot = await connection.getFirstAvailableBlock();

console.log(minSlot);

example.py

pythonimport requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers={'Content-Type': 'application/json'},
    json={
        'jsonrpc': '2.0',
        'method': 'minimumLedgerSlot',
        'params': [],
        'id': 'getblock.io'
    }
)

print(response.json()['result'])

example.rs

rustuse reqwest::Client;
use serde_json::{json, Value};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();

    let response = client
        .post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
        .header("Content-Type", "application/json")
        .json(&json!({
            "jsonrpc": "2.0",
            "method": "minimumLedgerSlot",
            "params": [],
            "id": "getblock.io"
        }))
        .send()
        .await?
        .json::<Value>()
        .await?;

    println!("Result: {}", response["result"]);
    Ok(())
}

Response

json{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": 386201344
}

Response Parameters

ParameterTypeDescription
jsonrpcstringJSON-RPC protocol version ("2.0")
idstringRequest identifier matching the request
resultnumberLowest slot retained in the node's local ledger

Use Cases

  • Retention Checks: Confirm a node still holds the slot range an application depends on
  • Purge Monitoring: Track how quickly ledger cleanup advances on a dedicated node
  • Query Routing: Send requests below this slot to an archival endpoint
  • Disk Planning: Correlate retained slot depth with node storage capacity

Error Handling

Error CodeMessageDescription
-32603Internal errorNode failed to read the ledger cleanup slot
-32005Node is unhealthyThe node has fallen behind the cluster tip