Skip to main content

0.05 credits per call

getLeaderSchedule on Solana: Returns the leader schedule for an epoch.

Endpoint

https://rpc.goldrushdata.com/v1/solana-mainnet
Authenticate with Authorization: Bearer <GOLDRUSH_API_KEY>. See authentication.

Parameters

NameTypeRequiredDescriptionExample
slotu64noSlot whose epoch’s schedule to fetch; defaults to the current epoch.372877175
configobjectno{commitment?, identity?}. identity filters to a single validator.{"identity":"ENvAW7JScgYq6o4zKZwewtkzzJgDzuJAFxYasvmEQdpS"}

Returns

object | null: Map of leader pubkey → array of slot indices, or null if the epoch has no schedule.
{"ENvAW7JScgYq6o4zKZwewtkzzJgDzuJAFxYasvmEQdpS":[0,1,2,3,4,5,6,7]}

Examples

curl https://rpc.goldrushdata.com/v1/solana-mainnet \
  -H "Authorization: Bearer $GOLDRUSH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getLeaderSchedule",
    "params": [372877175, {"identity":"ENvAW7JScgYq6o4zKZwewtkzzJgDzuJAFxYasvmEQdpS"}]
  }'
import {
  createDefaultRpcTransport,
  createSolanaRpcFromTransport,
} from "@solana/kit";

const transport = createDefaultRpcTransport({
  url: "https://rpc.goldrushdata.com/v1/solana-mainnet",
  headers: { Authorization: `Bearer ${process.env.GOLDRUSH_API_KEY}` },
});
const rpc = createSolanaRpcFromTransport(transport);

const result = await rpc.getLeaderSchedule(372877175, {"identity":"ENvAW7JScgYq6o4zKZwewtkzzJgDzuJAFxYasvmEQdpS"}).send();
console.log(result);
import os
import requests

resp = requests.post(
    "https://rpc.goldrushdata.com/v1/solana-mainnet",
    headers={
        "Authorization": f"Bearer {os.environ['GOLDRUSH_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={"jsonrpc": "2.0", "id": 1, "method": "getLeaderSchedule", "params": [372877175, {"identity":"ENvAW7JScgYq6o4zKZwewtkzzJgDzuJAFxYasvmEQdpS"}]},
)
print(resp.json()["result"])

Errors

Standard JSON-RPC errors: -32600 invalid request, -32601 method not found, -32602 invalid params.