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`](./getSlotLeaders.md), or fetch the full epoch schedule with [`getLeaderSchedule`](./getLeaderSchedule.md).
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://<your-endpoint>/ \
-X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"getSlotLeader","params":["<config>"]}'const res = await fetch("https://<your-endpoint>/", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"id": 1,
"method": "getSlotLeader",
"params": [
"<config>"
],
"jsonrpc": "2.0"
}),
});
const data = await res.json();import requests
resp = requests.post("https://<your-endpoint>/", 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.