TriportRPC

getSlotLeaders

Last updated:

getSlotLeaders returns the validator that is scheduled to produce each slot over a window of the leader schedule. Given a startSlot and a limit, it returns an ordered array of base-58 validator identity public keys: element 0 is the leader of startSlot, element 1 of startSlot + 1, and so on.

Use it to predict which validator will produce upcoming slots — for example to route a transaction toward the next leader's TPU, to attribute confirmed slots to a validator, or to render an upcoming leader schedule. Because Solana assigns leaders in fixed-size groups of consecutive slots, you will typically see the same pubkey repeated for several entries in a row.

The window must fall within the leader schedule the cluster currently knows about (the current and next epoch). Requesting a startSlot too far in the future, or a limit outside the 1–5000 range, returns an invalid-params error rather than a partial list.

Parameters

getSlotLeaders parameters
NameTypeRequiredDescription
startSlotSlotYes
limitintegerYes

Returns

getSlotLeaders return value
FieldType
resultarray

Examples

curl https://triport.io/sol \
  -X POST -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <api-key>' \
  -d '{"id":1,"method":"getSlotLeaders","params":["<startSlot>","<limit>"],"jsonrpc":"2.0"}'
const res = await fetch("https://triport.io/sol", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
  body: JSON.stringify({
  "id": 1,
  "method": "getSlotLeaders",
  "params": [
    "<startSlot>",
    "<limit>"
  ],
  "jsonrpc": "2.0"
}),
});
const data = await res.json();
import requests
resp = requests.post(
    "https://triport.io/sol",
    headers={"Authorization": "Bearer <api-key>"},
    json={"id":1,"method":"getSlotLeaders","params":["<startSlot>","<limit>"],"jsonrpc":"2.0"},
)
print(resp.json())

Usage

  1. Transport: HTTP (JSON-RPC).
  2. Networks: mainnet, devnet, testnet.
  3. Credit cost: 1 per call.

FAQ

What does getSlotLeaders do?
Returns the ordered list of slot leaders (validator identity pubkeys) for a contiguous range of slots.
How many credits does getSlotLeaders cost?
getSlotLeaders costs 1 credit(s) per call on Triport by default.
Is getSlotLeaders available over WebSocket?
getSlotLeaders is an HTTP JSON-RPC method.