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

OpenInfra.shopeninfra.sh

getBlocksWithLimit

Returns up to limit confirmed block slots, starting at startSlot.

Request

{  "jsonrpc": "2.0",  "id": 1,  "method": "getBlocksWithLimit",  "params": [    5,    3,    {      "commitment": "finalized"    }  ]}

Parameters

ParameterTypeRequiredDescription
startSlotu64YesThe first slot to return. Confirmed blocks at or after this slot are included.
limitusizeYesMaximum number of blocks to return. Must not exceed 500000. Pass 0 to receive an empty array.
commitmentstringNoCommitment level: confirmed or finalized (default). processed is not accepted.
minContextSlotnumberNoMinimum slot at which the request may be evaluated.

Commitment levels

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 — it has reached maximum vote lockout and is recognized by at least two-thirds of active stake. Strongest guarantee.

Response

{  "jsonrpc": "2.0",  "result": [5, 6, 7],  "id": 1}
FieldTypeDescription
resultu64[]Array of confirmed block slot numbers starting at startSlot, up to limit entries. Empty array when limit is 0 or no blocks exist in range.

If no confirmed blocks exist between startSlot and the end of the available chain, the result is an empty array. Gaps in the sequence indicate skipped slots with no confirmed block.