getBlocksWithLimit - Solana

getBlocksWithLimit. Retrieves a list of confirmed blocks starting from a specified slot up to a given limit on the Solana blockchain

getBlocksWithLimit - solana [Value: 5CU]
Retrieves a list of confirmed blocks starting from a specified slot up to a given limit on the Solana blockchain
Use cases

Use cases

  • Retrieve specific number of blocks for data analysis
  • Fetch recent blocks to monitor blockchain activities
  • Analyze limited block data for performance optimization
Constraints

Constraints

  • Requires valid starting block number parameter
  • Network latency can impact retrieval times
  • Frequent queries may trigger rate limiting mechanisms
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl --location --request POST 'https://solana.drpc.org' \
--header 'Content-Type: application/json' \
--data-raw '{"jsonrpc": "2.0","id":1,"method":"getBlocksWithLimit","params":[5, 3]}'
Copy
Response
200
{
    "jsonrpc": "2.0",
    "result": [
        5,
        6,
        7
    ],
    "id": 1
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray
array
start_slotuint64
limituint64
commitmentstring
The level of commitment required for the query
  • 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 not be complete

Response

200
An array of block numbers starting from the specified slot and extending up to the given limit that have been confirmed

Response params

array of integers
idinteger
jsonrpcstring
resultstring