getSlotLeaders
Returns the slot leaders for a given slot range. Each entry in the returned array corresponds to the validator identity scheduled to be the leader for that slot. This method is useful for predicting upcoming leaders, optimizing transaction submission timing, and building leader schedule visualizations. The range is limited to a maximum of 5,000 slots.
Parameters
| # | Type | Required | Description |
|---|---|---|---|
| 1 | u64 | Yes | Start slot |
| 2 | u64 | Yes | Number of slots to return leaders for (1-5000) |
Response
Returns an array:
| Field | Type | Description |
|---|---|---|
result | array[string] | Array of base-58 encoded validator identity public keys, one per slot |
Code Examples
cURL
curl http://88.216.36.108:7999 -X POST -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getSlotLeaders",
"params": [
166974442, 10
]
}'TypeScript
const response = await fetch("http://88.216.36.108:7999", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "getSlotLeaders",
params: [
166974442, 10
]
}),
});
const { result } = await response.json();
console.log("Leaders:", result.length, "slots");Python
import requests
response = requests.post("http://88.216.36.108:7999", json={
"jsonrpc": "2.0",
"id": 1,
"method": "getSlotLeaders",
"params": [
166974442, 10
]
})
result = response.json()["result"]
print(f"Leaders: {len(result)} slots")Rust
use reqwest::Client;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let res = client.post("http://88.216.36.108:7999")
.json(&json!({
"jsonrpc": "2.0",
"id": 1,
"method": "getSlotLeaders",
"params": [
166974442_u64, 10_u64
]
}))
.send().await?
.text().await?;
println!("{}", res);
Ok(())
}Example Response
{
"jsonrpc": "2.0",
"result": [
"ChorusmmC7UypFMn6WKLH2jxEpPhRFY7XhrmYYMRxuPA",
"ChorusmmC7UypFMn6WKLH2jxEpPhRFY7XhrmYYMRxuPA",
"ChorusmmC7UypFMn6WKLH2jxEpPhRFY7XhrmYYMRxuPA",
"Certusm1sa411sMpV9FPqU5dXAYhmmhygvxJ23S6hJ24",
"Certusm1sa411sMpV9FPqU5dXAYhmmhygvxJ23S6hJ24"
],
"id": 1
}