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

OpenInfra.shopeninfra.sh

getBlocks

Returns confirmed block slots in the inclusive range starting at startSlot and ending at endSlot, if provided.

Request

{  "jsonrpc": "2.0",  "id": 1,  "method": "getBlocks",  "params": [    377268280,    377268285,    {      "commitment": "finalized"    }  ]}

Parameters

ParameterTypeRequiredDescription
startSlotu64YesInclusive start slot for the range of blocks to return.
endSlotu64 | objectNoInclusive end slot. Must be no more than 500,000 slots higher than startSlot. For backwards compatibility this position may also accept a configuration object (same shape as config) when an end slot is not needed.
configobjectNoConfiguration object. Only used when endSlot is provided as a number. Contains commitment and optional minContextSlot.

config fields

The config object is accepted as the third parameter when endSlot is a number, or as the second parameter (in place of endSlot) when no end slot is needed.

FieldTypeDescription
commitmentstringCommitment level. Accepted values: confirmed, finalized. Defaults to finalized. processed is not supported.
minContextSlotnumberMinimum slot at which the request may be evaluated.

commitment values

ValueDescription
confirmedReturn data from the highest slot that at least two-thirds of active stake has directly voted to confirm. More stable than processed, but weaker than finalized.
finalizedReturn data from the highest slot the cluster recognizes as finalized — at maximum vote lockout, recognized by at least two-thirds of active stake. Strongest commitment level.

Response

{  "jsonrpc": "2.0",  "result": [5, 6, 7, 8, 9, 10],  "id": 1}
FieldTypeDescription
resultu64[]Array of confirmed block slot numbers between startSlot and endSlot (or the highest available slot at the requested commitment), inclusive. Returns an empty array when endSlot is lower than startSlot. Maximum range is 500,000 slots.

If endSlot is omitted, the range extends to the highest slot available at the requested commitment level. The maximum allowed range is 500,000 slots.