Metode RPC getLatestBlockhash

Mengembalikan blockhash terbaru

Batasan Versi

Metode ini hanya tersedia di solana-core v1.9 atau yang lebih baru. Silakan gunakan getRecentBlockhash untuk solana-core v1.8 dan di bawahnya.

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

params

objectoptional

Objek konfigurasi yang berisi bidang-bidang berikut:

result

Response
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 2792
},
"value": {
"blockhash": "EkSnNWid2cvwEVnVx9aBqawnmiCNiDgp3gUdkDPTKN1N",
"lastValidBlockHeight": 3090
}
},
"id": 1
}
object

Objek JSON RpcResponse dengan bidang value yang diatur ke objek JSON yang mencakup:

Is this page helpful?