Solana
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Solana
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
getBlockProduction reports, per validator, how the leader schedule played out over a slot range on Solana — the Proof-of-History and Proof-of-Stake network secured by staked SOL. The response wraps a byIdentity map keyed by validator identity pubkey, where each entry is [leaderSlots, blocksProduced]: how many slots that validator was assigned as leader, and how many of those slots it actually produced a block for. The difference between the two is the validator's skip count. Without a range, the method covers the current epoch; you can also pass identity to filter to a single validator. Call it against https://solana.therpc.io/YOUR_API_KEY as a JSON-RPC 2.0 POST.
leaderSlots against blocksProduced — the gap is how many assigned leader slots it missed.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | config | object | No | Options: commitment, identity (filter to one validator), range {firstSlot, lastSlot}. |
| Tipo | Descripción |
|---|---|
| object | RpcResponse wrapping { byIdentity: {pubkey:[leaderSlots, blocksProduced]}, range }. |
| Código | Mensaje | Causa |
|---|---|---|
-32602 | Invalid params | A param is missing, of the wrong type, or malformed (e.g. a non-base58 pubkey or a bad config field). |
-32603 | Internal error | The node hit an internal error serving the request — retry, and reduce the requested range/encoding if it persists. |
range the method covers the entire current epoch, which can be a large span on Solana. Pass range with firstSlot and lastSlot to scope it to the window you actually care about.leaderSlots counts every slot the validator was scheduled to lead, including ones it skipped, so blocksProduced is often lower — that shortfall is the point of the metric, not an error.