getSlotLeader — Solana JSON-RPC

Status: Available

Returns the identity public key of the validator that leads the current slot.

POSThttps://triport.io/sol
Network
Solana
Scope
sol_read_rpc
Auth
x-token: $TRIPORT_API_KEY (or Authorization: Bearer)
Rate limit
free+ · 20 / 60 / 200 / 600 rps (free / basic / pro / business)

Endpoint and plans: Solana RPC endpoint.

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

The single positional parameter is an optional config object.

configobjectoptional
Configuration object (see fields below). Omit it entirely for defaults.
config.commitmentstringoptional
Commitment level for the query: processed, confirmed, or finalized. Defaults to finalized.
config.minContextSlotinteger (u64)optional
The minimum slot at which the request may be evaluated.

Response

Response fields

FieldTypeDescription
jsonrpcstringAlways "2.0".
idstring | integerEchoes the id from the request, for correlating responses.
resultstring (Pubkey)Base-58 encoded identity public key of the current slot leader (32–44 chars).

Errors

Errors arrive in the standard JSON-RPC error object (code, message, data).

CodeTriport codeWhen it happens
-32602invalid_paramsThe config object contains an unknown field or a malformed value (e.g. an invalid commitment enum value).
429rate_limitedYou exceeded your tier's sustained RPS for sol_read_rpc. An HTTP error, not a JSON-RPC one — the request is rejected before the RPC layer: body {"error":"rate_limited", …} with limit_rps, burst_capacity and retry_after_sec, plus Retry-After and X-RateLimit-Reset headers.

See the shared errors reference for the full envelope, the data fields, and which errors are plain HTTP rather than JSON-RPC.

Examples

JavaScript (fetch)

const res = await fetch("https://triport.io/sol", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "getSlotLeader",
    params: [{ commitment: "finalized" }],
  }),
});


const { result: leader } = await res.json();
console.log(leader); // "ENJ7iD7BsFrFzaXTrbAVbDYZ12Z4BuRMpfGd3GPnaQbm"

Notes

  • commitment defaults to finalized when omitted; pass processed for the most up-to-date (but least settled) view of the current leader.
  • The leader changes as the cluster advances — each leader produces a fixed run of consecutive slots — so the value is only accurate for the moment it was observed. For forward-looking lookups use a range method instead.
  • id may be any client-chosen string or integer; it is echoed back so you can correlate responses.
  • This is a sol_read_rpc method available from the Free trial up; throughput scales with your plan (20 → 600 rps) with burst allowance. There is no daily quota.
  • Related: getSlotLeaders, getLeaderSchedule, getSlot.