getSlotLeader
Last updated:
getSlotLeader returns a single Pubkey — the base-58 encoded identity public
key of the validator scheduled to produce the block for the slot currently being
processed by the node.
Use it for a quick, point-in-time answer to "who is leader right now?" — for example to label live transaction routing or to surface the active validator in a dashboard. The result reflects the slot resolved at the requested commitment level, so it tracks the leader as the cluster advances.
To look up leaders for a range of upcoming slots rather than just the
current one, use getSlotLeaders, or fetch the full
epoch schedule with getLeaderSchedule.
All Solana JSON-RPC methods POST to the same base path /v1/sol; the method
field in the request body selects the call.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| config | CommitmentConfig | 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":"getSlotLeader","params":["<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": "getSlotLeader",
"params": [
"<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":"getSlotLeader","params":["<config>"],"jsonrpc":"2.0"},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Networks: mainnet, devnet, testnet.
- Credit cost: 1 per call.
FAQ
- What does getSlotLeader do?
- Returns the identity public key of the validator that leads the current slot.
- How many credits does getSlotLeader cost?
- getSlotLeader costs 1 credit(s) per call on Triport by default.
- Is getSlotLeader available over WebSocket?
- getSlotLeader is an HTTP JSON-RPC method.