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β
Fields | Type | Description |
---|---|---|
blocknumber | string | The 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β
Name | Type | Description |
---|---|---|
blocknumber* | string | 0x994f28 |
- 200: OK Expand for a detailed response example
{
"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
}'