Skip to main content


Retrieves the newest header via subscription.

Clients can create a subscription to get updates on the newest block headers as they are created using the chain_subscribeAllHeads function. Apps that require real-time information on new blocks added to the blockchain depend on this constant flow of data. With the subscription system, clients are updated quickly and don't have to poll the network frequently.

Example Request and Result for chain_subscribeAllHeads method

In this section, we provide an illustrative example of a request made to retrieve details contents using the chain_subscribeAllHeads method. Additionally, we present the resulting response containing information about getting the newest header using WS subscription.


subscriptionstringManages the subscription to header updates.

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!

Retrieves the newest header via subscription.

POST wss://<project-id>

Request Body

"jsonrpc": "2.0",
"method": "chain_allHead",
"params": {
"subscription": "GP0sH6g9qR8lQEmD",
"result": {
"parentHash": "0xcb66928b4ad7b7855f6aaec981c0025620bc1e834f9b15f082e24b5ac9d0b609",
"number": "0x99c5b8",
"stateRoot": "0xf7d74721a9b1d545d444f9aef703a14f4741b4ea739f47d751337ad3ab6b1d71",
"extrinsicsRoot": "0x6c30cc0fa254a472cdb5a7068cdd46ee4d5e2a3c0dfa84de001ca893d7b9a405",
"digest": {
"logs": [

Curl Request example

wscat -c 'wss://<project-id>'
# wait for connection
"id": 1,
"jsonrpc": "2.0",
"method": "chain_subscribeAllHeads",
"params": []