TriportRPC

getLeaderSchedule

Last updated:

`getLeaderSchedule` returns the leader schedule for an epoch: a map keyed by validator identity pubkey, where each value is the array of slot indices (relative to the start of the epoch) that the validator is assigned to lead. This is the canonical way to know, ahead of time, which validator will be the leader for a given slot — useful for transaction-routing optimizations, leader forecasting, and validator-performance dashboards.

The slot indices are **epoch-relative**: index `0` is the first slot of the epoch. To convert an index into an absolute slot, add it to the epoch's first slot (use [`getEpochInfo`](./getEpochInfo.md) / [`getEpochSchedule`](./getEpochSchedule.md) to find epoch boundaries).

By default the call returns the schedule for the epoch that contains the current slot. Pass an optional `slot` to query the epoch containing that slot, and an optional `config` to set a commitment level or to filter the result to a single validator via `identity`. If the requested slot does not correspond to a known epoch, the result is `null`.

Parameters

getLeaderSchedule parameters
NameTypeRequiredDescription
slotSlotNo
configGetLeaderScheduleConfigNo

Returns

getLeaderSchedule return value
FieldType
resultobject

Examples

curl https://<your-endpoint>/ \
  -X POST -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"getLeaderSchedule","params":["<slot>","<config>"]}'
const res = await fetch("https://<your-endpoint>/", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "id": 1,
  "method": "getLeaderSchedule",
  "params": [
    "<slot>",
    "<config>"
  ],
  "jsonrpc": "2.0"
}),
});
const data = await res.json();
import requests
resp = requests.post("https://<your-endpoint>/", json={"id":1,"method":"getLeaderSchedule","params":["<slot>","<config>"],"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 getLeaderSchedule do?
Returns the leader schedule for an epoch — which slots each validator is assigned to produce blocks in.
How many credits does getLeaderSchedule cost?
getLeaderSchedule costs 1 credit(s) per call on Triport by default.
Is getLeaderSchedule available over WebSocket?
getLeaderSchedule is an HTTP JSON-RPC method.