Skip to main content

chain_getHead

Get hash of the n-th block in the canon chain. By default returns latest block hash.​

info

chain_getHead method has an alias named chain_getBlockHash

Example Request and Result for chain_getHead method​

In this section, we provide an illustrative example of a request made to retrieve details contents using the chain_getHead method. Additionally, we present the resulting response containing information about the n-th block in the canon chain.

Parameters​

FieldsTypeDescription
blocknumberstringThe value indicating the β€˜n-th’ block in the chain

One of the following parameter types is allowed:

  • HEX - (OPTIONAL) The value indicating the β€˜n-th’ block in the chain.
  • U32 - (OPTIONAL) The value indicating the β€˜n-th’ block in the chain.
  • ARRAY - (OPTIONAL) Multiple values, where each value can be one of the following types:
    • HEX - The value indicating the β€˜n-th’ block in the chain.
    • U32 - The value indicating the β€˜n-th’ block in the chain.
info

The example in this section uses a non-existing project id.

Make sure you replace it with your Vara Mainnet endpoint when issuing the API calls.

Don't have a project id? Here's a straightforward guide on how to obtain one!

Get hash of the n-th block in the canon chain. By default returns latest block hash.​

POST https://vara-mainnet.blastapi.io/<project-id>

Request Body​

NameTypeDescription
blocknumber*string0x994f28
{
"jsonrpc": "2.0",
"result": "0x691411494e6b767394741ec1a6c19b4dc651f522991cfaa441f2346395f2f625",
"id": 1
}

Curl Request example​

curl --location 'https://vara-mainnet.blastapi.io/<project-id>' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "chain_getHead",
"params": [50, "0x64", 200],
"id": 1
}'