Metode RPC getBlocksWithLimit

Mengembalikan daftar blok yang terkonfirmasi dimulai dari slot yang ditentukan

$ 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 awal

u64optional

Batas (tidak boleh lebih dari 500.000 blok lebih tinggi dari start_slot)

objectoptional

Objek konfigurasi

result

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

Array integer u64 yang mencantumkan blok-blok terkonfirmasi dimulai dari start_slot hingga sampai limit blok, inklusif.

Is this page helpful?