Skip to main content

getBlocks

POST

Returns a list of confirmed blocks between two slots.
param[0]
startSlotintegerrequired
The slot number.
param[1]
endSlotintegerrequired
The slot number.
param[2]
configurationObjectobjectrequired
commitmentstring
The commitment describes how finalized a block is at that point in time.
  • finalized - the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized
  • confirmed - the node will query the most recent block that has been voted on by supermajority of the cluster.
  • processed - the node will query its most recent block. Note that the block may still be skipped by the cluster.
Responses
idinteger
The request ID
jsonrpcstring
The JSON-RPC version
resultarray
An array of u64 integers listing confirmed blocks between start_slot and either end_slot - if provided, or latest confirmed slot, inclusive. Max range allowed is 500,000 slots.
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "Bad Request"
}
cURL
curl -X POST 'https://solana-mainnet.nodit.io' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getBlocks",
"params": [
338967300,
338967310,
{
"commitment": "finalized"
}
]
}'