curl --request POST \
--url https://solana-mainnet.core.chainstack.com/83e0d6661ee0488e22e167c18818cb38 \
--header 'Content-Type: application/json' \
--data '{
"id": 45,
"jsonrpc": "2.0",
"method": "isBlockhashValid",
"params": [
"AspJzsEukGPuLYsebpUSSeS79GtYVVh6Bn4478qWXqBK",
{
"commitment": "processed"
}
]
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": true
}
curl --request POST \
--url https://solana-mainnet.core.chainstack.com/83e0d6661ee0488e22e167c18818cb38 \
--header 'Content-Type: application/json' \
--data '{
"id": 45,
"jsonrpc": "2.0",
"method": "isBlockhashValid",
"params": [
"AspJzsEukGPuLYsebpUSSeS79GtYVVh6Bn4478qWXqBK",
{
"commitment": "processed"
}
]
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": true
}
isBlockhashValid
method checks whether a given blockhash is still valid.
This method is useful for determining if a previously fetched blockhash can still be used for transaction submission. It helps prevent the use of expired blockhashes, which would cause transactions to fail.
blockhash
— the blockhash to validate, as a base-58 encoded string.commitment
— (optional) the level of commitment desired:
processed
— the node has processed the block and the block may be on a fork.confirmed
— the block is confirmed by the cluster as not being on a fork.finalized
— the block is finalized by the cluster.result
— a boolean indicating whether the blockhash is still valid:
true
— the blockhash is valid and can be used for transaction submission.false
— the blockhash is no longer valid and should not be used.isBlockhashValid
is in transaction retry logic. When a transaction fails due to network issues, an application can use this method to check if the original blockhash is still valid before retrying the transaction. If the blockhash is no longer valid, the application knows it needs to fetch a new blockhash before retrying.Blockhash validity status
The response is of type object
.
Was this page helpful?