Método RPC getBlock
Devuelve información de identidad y transacción sobre un bloque confirmado en el ledger
$ curl https://api.devnet.solana.com -s -X \> POST -H "Content-Type: application/json" -d '> {> "jsonrpc": "2.0",> "id": 1,> "method": "getBlock",> "params": [> 378967388,> {> "commitment": "finalized",> "encoding": "json",> "transactionDetails": "full",> "maxSupportedTransactionVersion": 0,> "rewards": false> }> ]> }> '
params
u64required
Número de slot.
objectoptional
Objeto de configuración.
result
Response
{"jsonrpc": "2.0","result": {"blockHeight": 428,"blockTime": null,"blockhash": "3Eq21vXNB5s86c62bVuUfTeaMif1N2kUqRPBmGRJhyTA","parentSlot": 429,"previousBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B","transactions": [{},}}]},"id": 1}
object | null
Si el bloque especificado no está confirmado, el resultado será null
. De lo
contrario, un objeto que contiene:
Is this page helpful?