Metode RPC getBlocks

Mengembalikan daftar blok yang terkonfirmasi antara dua slot

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

params

u64required

Slot awal

u64optional

Slot akhir (tidak boleh lebih dari 500.000 blok lebih tinggi dari start_slot)

objectoptional

Objek konfigurasi

result

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

Sebuah array bilangan bulat u64 yang mencantumkan blok-blok yang terkonfirmasi antara start_slot dan baik end_slot - jika disediakan, atau slot terkonfirmasi terbaru, inklusif. Rentang maksimum yang diizinkan adalah 500.000 slot.

Is this page helpful?