TriportRPC

getBlockProduction

POSThttps://api.triport.io/v1/sol

Returns recent block-production information for the current or previous epoch, broken down per validator.

Solanasol_read_rpcfree+ — 20 / 60 / 200 / 600 RPS (free / basic / pro / business)

getBlockProduction reports how many leader slots each validator was assigned and how many of those slots actually produced a block, over a slot range within the current (or previous) epoch. It is the canonical way to measure a validator's skip rate — the gap between slotsAssigned and blocksProduced — and to inspect overall leader-schedule performance.

The result is returned as an RpcResponse envelope: a context with the slot the data was evaluated against, and a value containing a byIdentity map (keyed by validator identity pubkey) plus the range the figures cover.

By default the call returns data for every validator over the current epoch so far. Narrow it with the optional config: pass identity to restrict the result to a single validator pubkey, and range (firstSlot / lastSlot) to bound the slot window. When range is omitted, the range starts at the first slot of the current epoch and ends at the highest slot the node has reached.

Parameters

JSON-RPC params is a positional array: [config?]. The single element is an optional configuration object; omit it (or pass []) to query the full current epoch.

configobjectoptional
Optional configuration object (see below).
commitmentstringoptional
Commitment level: processed, confirmed, or finalized.
identitystring (base-58)optional
Restrict results to a single validator identity pubkey. Must match ^[1-9A-HJ-NP-Za-km-z]{32,44}$.
rangeobjectoptional
Slot range to report over.
range.firstSlotintegeroptional
First slot to report production for (inclusive). Must be within the current or previous epoch.
range.lastSlotintegeroptional
Last slot to report production for (inclusive). Defaults to the highest slot reached.

Response

The validator Awes4Tr6… was assigned 2048 leader slots in the queried range and produced 2039 blocks (9 skipped slots, a ~0.44% skip rate).

resultobject
BlockProduction envelope.
result.contextobject
The context the response was evaluated against.
result.context.slotinteger
The slot at which the data was read.
result.context.apiVersionstring
The node software version that served the request.
result.valueobject
The block-production payload.
result.value.byIdentityobject
Map of validator identity pubkey → [slotsAssigned, blocksProduced] (a two-element integer array).
result.value.rangeobject
The slot range the figures cover.
result.value.range.firstSlotinteger
First slot of the reported range (inclusive).
result.value.range.lastSlotinteger
Last slot of the reported range (inclusive).

Errors

Errors are returned in the standard JSON-RPC error envelope. See the shared errors reference for the full envelope shape and shared codes.

CodeMeaningWhen it happens
-32602Invalid paramsidentity is not a valid base-58 pubkey, range is malformed, or firstSlot/lastSlot fall outside the current or previous epoch.
401UnauthorizedMissing or invalid Authorization: Bearer key.
429Rate limitedMore than your tier's RPS for sol_read_rpc (20 / 60 / 200 / 600).

Examples

JavaScript (fetch)

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


const { result } = await res.json();
for (const [pubkey, [assigned, produced]] of Object.entries(result.value.byIdentity)) {
  const skipRate = ((assigned - produced) / assigned) * 100;
  console.log(`${pubkey}: ${produced}/${assigned} (${skipRate.toFixed(2)}% skipped)`);
}

TypeScript SDK (@triport/sdk)

import { TriportClient } from "@triport/sdk";


const client = new TriportClient({ apiKey: process.env.TRIPORT_API_KEY });


const { context, value } = await client.solana.getBlockProduction({
  identity: "Awes4Tr6TX8JDzEhCZY2QVNimT6iD1zWHzf1vNyGvpLM",
  commitment: "finalized",
});


const [assigned, produced] = value.byIdentity[
  "Awes4Tr6TX8JDzEhCZY2QVNimT6iD1zWHzf1vNyGvpLM"
];
console.log(`${produced}/${assigned} slots produced (slot ${context.slot})`);

Python (triport-sdk)

import os
from triport import TriportClient


client = TriportClient(api_key=os.environ["TRIPORT_API_KEY"])


result = client.solana.get_block_production(
    identity="Awes4Tr6TX8JDzEhCZY2QVNimT6iD1zWHzf1vNyGvpLM",
    commitment="finalized",
)


for pubkey, (assigned, produced) in result["value"]["byIdentity"].items():
    skip_rate = (assigned - produced) / assigned * 100
    print(f"{pubkey}: {produced}/{assigned} ({skip_rate:.2f}% skipped)")

Notes

  • [slotsAssigned, blocksProduced] order: each byIdentity entry is a two-element array — leader slots assigned first, blocks produced second. The difference is the validator's skipped-slot count.
  • Current epoch by default: with no range, the window covers the current epoch from its first slot up to the latest slot the node has reached. range may only reference the current or previous epoch.
  • Filter early: pass identity to retrieve a single validator instead of the full cluster map — much smaller responses for per-validator dashboards.
  • Related methods: use getEpochInfo to find the current epoch's slot boundaries before constructing a range, and getLeaderSchedule to see which slots a validator is assigned ahead of time.