getBlocks RPC-Methode

Gibt eine Liste bestätigter Blöcke zwischen zwei Slots zurück

$ 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

Start-Slot

u64optional

End-Slot (darf nicht mehr als 500.000 Blöcke höher sein als der start_slot)

objectoptional

Konfigurationsobjekt

result

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

Ein Array von u64-Ganzzahlen, das bestätigte Blöcke zwischen start_slot und entweder end_slot - falls angegeben, oder dem neuesten bestätigten slot, einschließlich, auflistet. Der maximal erlaubte Bereich beträgt 500.000 slots.

Is this page helpful?