getBlockProduction
https://api.triport.io/v1/solReturns recent block-production information for the current or previous epoch, broken down per validator.
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.
configobjectoptionalcommitmentstringoptionalprocessed, confirmed, or finalized.identitystring (base-58)optional^[1-9A-HJ-NP-Za-km-z]{32,44}$.rangeobjectoptionalrange.firstSlotintegeroptionalrange.lastSlotintegeroptionalResponse
The validator Awes4Tr6… was assigned 2048 leader slots in the queried range
and produced 2039 blocks (9 skipped slots, a ~0.44% skip rate).
resultobjectBlockProduction envelope.result.contextobjectresult.context.slotintegerresult.context.apiVersionstringresult.valueobjectresult.value.byIdentityobject[slotsAssigned, blocksProduced] (a two-element integer array).result.value.rangeobjectresult.value.range.firstSlotintegerresult.value.range.lastSlotintegerErrors
Errors are returned in the standard JSON-RPC error envelope. See the shared errors reference for the full envelope shape and shared codes.
| Code | Meaning | When it happens |
|---|---|---|
-32602 | Invalid params | identity is not a valid base-58 pubkey, range is malformed, or firstSlot/lastSlot fall outside the current or previous epoch. |
401 | Unauthorized | Missing or invalid Authorization: Bearer key. |
429 | Rate limited | More 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: eachbyIdentityentry 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.rangemay only reference the current or previous epoch. - Filter early: pass
identityto retrieve a single validator instead of the full cluster map — much smaller responses for per-validator dashboards. - Related methods: use
getEpochInfoto find the current epoch's slot boundaries before constructing arange, andgetLeaderScheduleto see which slots a validator is assigned ahead of time.