getLatestBlockhash RPC Method
Returns the latest blockhash
params
object
optional
Configuration object containing the following fields:commitment
The commitment describes how finalized a block is at that point in time. See Configuring State Commitment.
minContextSlot
The minimum slot that the request can be evaluated at
result
object
RpcResponse JSON object with value field set to a JSON object including:blockhash
A Hash as base-58 encoded string
lastValidBlockHeight
Last block height at which the blockhash will be valid
cURL
curl https://us-seattle.openverse.network/api -s -X \
POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getLatestBlockhash",
"params": [
{
"commitment": "processed"
}
]
}
'
Response
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 2792
},
"value": {
"blockhash": "EkSnNWid2cvwEVnVx9aBqawnmiCNiDgp3gUdkDPTKN1N",
"lastValidBlockHeight": 3090
}
},
"id": 1
}