curl --request POST \
--url https://nd-326-444-187.p2pify.com/9de47db917d4f69168e3fed02217d15b \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "getRecentBlockhash"
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": {
"context": {
"slot": 123
},
"value": {
"blockhash": "<string>",
"feeCalculator": {
"lamportsPerSignature": 123
}
}
}
}
curl --request POST \
--url https://nd-326-444-187.p2pify.com/9de47db917d4f69168e3fed02217d15b \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "getRecentBlockhash"
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": {
"context": {
"slot": 123
},
"value": {
"blockhash": "<string>",
"feeCalculator": {
"lamportsPerSignature": 123
}
}
}
}
getRecentBlockhash
method is deprecated starting from the Solana client v1.9. This method only works on older outdated clients v1.8 and below.For the currently supported and up-to-date method, see getLatestBlockhash .getRecentBlockhash
method returns a recent block hash from the ledger, and a fee schedule that can be used to compute the cost of submitting a transaction using it.
This method is crucial for transaction construction and submission in Solana. The returned blockhash is used to indicate when a transaction was constructed, which is important for security reasons. The fee calculator provides information about the current network fees.
blockhash
— a string representing the blockhash of a recent block.feeCalculator
— an object containing:
lamportsPerSignature
— the current fee in lamports per signature.getRecentBlockhash
is in transaction preparation. When constructing a transaction, you need to include a recent blockhash to ensure the transaction is processed in a timely manner and to prevent replay attacks. The fee calculator information can be used to estimate the cost of the transaction.Recent blockhash details
The response is of type object
.
Was this page helpful?