getSlotLeader
Returns the validator identity scheduled to produce the slot at the requested commitment.
Request
curl / JSON-RPC
{ "jsonrpc": "2.0", "id": 1, "method": "getSlotLeader", "params": [ { "commitment": "finalized" } ]}Kit
import { createSolanaRpc } from "@solana/kit"; const rpc_url = "https://rpc.openinfra.sh";const rpc = createSolanaRpc(rpc_url); let slotLeader = await rpc.getSlotLeader().send(); console.log(slotLeader);web3.js
import { Connection } from "@solana/web3.js"; const connection = new Connection("https://rpc.openinfra.sh", "confirmed"); let slotLeader = await connection.getSlotLeader(); console.log(slotLeader);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| commitment | string | No | Level of finality: processed | confirmed | finalized (default: finalized) |
| minContextSlot | number | No | Minimum slot at which the request may be evaluated. |
Commitment levels
| Value | Description |
|---|---|
| processed | Return data from the highest slot this node has processed on the fork it currently considers best. This is the newest view, but it can still change if the cluster switches forks. |
| confirmed | Return data from the highest slot that at least two-thirds of active stake has directly voted to confirm. More stable than processed, but a weaker guarantee than finalized. |
| finalized | Return data from the highest slot the cluster recognizes as finalized — the slot has reached maximum vote lockout in validators' vote towers and is recognized by at least two-thirds of active stake. This is the strongest commitment level. |
minContextSlot example
{ "minContextSlot": 341197000 }Response
{ "jsonrpc": "2.0", "result": "ENvAW7JScgYq6o4zKZwewtkzzJgDzuJAFxYasvmEQdpS", "id": 1}| Field | Type | Description |
|---|---|---|
| result | string | Node identity Pubkey of the current slot leader, as a base-58 encoded string. |