OpenInfra.sh is now live - Solana infrastructure, included with every server. LEARN MORE HERE >

OpenInfra.shopeninfra.sh

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

ParameterTypeRequiredDescription
commitmentstringNoLevel of finality: processed | confirmed | finalized (default: finalized)
minContextSlotnumberNoMinimum slot at which the request may be evaluated.

Commitment levels

ValueDescription
processedReturn 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.
confirmedReturn 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.
finalizedReturn 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}
FieldTypeDescription
resultstringNode identity Pubkey of the current slot leader, as a base-58 encoded string.