getBlocksWithLimit RPC 方法

返回从指定 slot 开始的已确认区块列表

$ curl https://api.devnet.solana.com -s -X \
> POST -H "Content-Type: application/json" -d '
> {
> "jsonrpc": "2.0",
> "id": 1,
> "method": "getBlocksWithLimit",
> "params": [
> 5,
> 3
> ],
> {
> "commitment": "finalized"
> }
> }
> '

params

u64required

起始 slot

u64optional

限制(必须不超过 start_slot 的 500,000 个区块)

objectoptional

配置对象

result

Response
{
"jsonrpc": "2.0",
"result": [5, 6, 7],
"id": 1
}
array

一个 u64 整数数组,列出从 start_slot 开始的已确认区块,最多包含 limit 个区块(包括在内)。

Is this page helpful?