For the complete documentation index, see llms.txt. This page is also available as Markdown.

minimumLedgerSlot - Solana

Example code for the minimumLedgerSlot JSON-RPC method. Complete guide on how to use the minimumLedgerSlot JSON-RPC method in the GetBlock Web3 documentation.

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

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "minimumLedgerSlot",
    "params": [],
    "id": "getblock.io"
}'
example.js
const { Connection } = require('@solana/web3.js');

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

const minSlot = await connection.getFirstAvailableBlock();

console.log(minSlot);
example.py
import requests

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

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

Response

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

Response Parameters

Parameter
Type
Description

jsonrpc

string

JSON-RPC protocol version ("2.0")

id

string

Request identifier matching the request

result

number

Lowest 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 Code
Message
Description

-32603

Internal error

Node failed to read the ledger cleanup slot

-32005

Node is unhealthy

The node has fallen behind the cluster tip

Was this helpful?