curl --request POST \
--url https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8 \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "1.0",
"method": "getbestblockhash",
"id": 1
}
'{
"result": "<string>",
"error": {},
"id": 123
}curl --request POST \
--url https://nd-202-842-353.p2pify.com/788f110831fe13808302bd79796d55e8 \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "1.0",
"method": "getbestblockhash",
"id": 1
}
'{
"result": "<string>",
"error": {},
"id": 123
}getbestblockhash method returns the hash of the best block in the most-work fully-validated chain. The best block is the tip of the blockchain, representing the most recent block that has been validated and added to the chain.
noneresult — a hex-encoded string representing the hash of the best block in the longest blockchain.error — an object containing an error message if an error occurred, otherwise null.id — an integer representing the ID of the request, used to match requests with responses.getbestblockhash method is useful for applications that need to know the current state of the blockchain. For example, a wallet application may use this method to determine the latest block to scan for transactions relevant to the wallet’s addresses.Was this page helpful?