Returns the leader schedule for the epoch that contains the supplied slot, or for the current epoch if no slot is supplied.
Source
$ curl https://api.devnet.solana.com -s -X \> POST -H "Content-Type: application/json" -d '> {> "jsonrpc": "2.0",> "id": 1,> "method": "getLeaderSchedule",> "params": [> null,> {> "commitment": "processed",> "identity": "dv2eQHeP4RFrJZ6UeiZWoc3XTtmtZCUKxxCApCDcRNV"> }> ]> }> '
params
u64 | object | nulloptional
Either the slot used to select the epoch, null to use the current slot at the
requested commitment, or a configuration object.
- If this parameter is a number, the RPC returns the leader schedule for the epoch that contains that slot.
- If this parameter is
nullor omitted, the RPC uses the current epoch. - If this parameter is an object, it has the same shape as
configand the request omits the slot.
When this parameter is an object, it contains:
| Field | Type | Description |
|---|---|---|
commitment | string | Commitment level used to select which slot the node reads from for this request. |
identity | string | Validator identity to filter for, as a base-58 encoded string. |
objectoptional
Configuration object containing the following fields. This parameter is only
used when slot is a number or null.
result
Response
{"jsonrpc": "2.0","result": {"4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP99F": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,57, 58, 59, 60, 61, 62, 63]},"id": 1}
object | null
Returns null if the requested epoch is unavailable. Otherwise returns an
object where:
- Keys are validator identities (as base-58 encoded strings)
- Values are arrays of leader slot indices relative to the first slot in the requested epoch
Is this page helpful?