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 /
getEpochSchedule 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
| Name | Type | Required | Description |
|---|---|---|---|
| slot | Slot | No | |
| config | GetLeaderScheduleConfig | No |
Returns
| Field | Type |
|---|---|
| result | object |
Examples
curl https://triport.io/sol \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"id":1,"method":"getLeaderSchedule","params":["<slot>","<config>"],"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": "getLeaderSchedule",
"params": [
"<slot>",
"<config>"
],
"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":"getLeaderSchedule","params":["<slot>","<config>"],"jsonrpc":"2.0"},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Networks: mainnet, devnet, testnet.
- 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.