Learn getSlotLeaders use cases, code examples, request parameters, response structure, and tips.
getSlotLeaders
RPC method allows you to retrieve a list of public keys for the validators scheduled to be leaders for a specific range of slots. This can be useful for understanding the upcoming sequence of block producers.
startSlot
(u64
): (Required) The first slot (inclusive) to fetch the leader schedule for.limit
(u64
): (Required) The number of consecutive slots to retrieve leaders for. The limit must be between 1 and 5,000.result
field of the JSON-RPC response is an array of base-58 encoded strings. Each string is the public key (identity) of a validator. The order of public keys in the array corresponds to the leader for each slot in the requested range, starting from startSlot
.
Example Response (for a limit of 3 slots):
limit
parameter specifies how many consecutive slot leaders to return, up to a maximum of 5,000. This means you can look ahead for a substantial number of slots within an epoch.startSlot
resides, up to the limit you provide or the end of that epoch’s known schedule if the RPC node doesn’t project further for that call.getLeaderSchedule
: While getSlotLeaders
gives you a direct list for a range, getLeaderSchedule
provides the full schedule for an entire epoch, mapping validator identities to all their assigned slots within that epoch. getSlotLeaders
is more direct if you only need a sequential list for a specific, limited range.getSlotLeaders
when you need to know the sequence of block producers for a defined upcoming segment of slots.