There are two URL resources available to check your SubQuery node health. They are:

/meta
/health

These commands are for Indexers running their own nodes and looking to get some base node stats.

/meta

To access node metadata endpoint, add /meta to the end of your SubQuery node url. For example:

http://localhost:3000/meta

This provides the following information:

{
"currentProcessingHeight": 6690954,
"currentProcessingTimestamp": 1630819063728,
"targetHeight": 6690954,
"bestHeight": 6690957,
"indexerNodeVersion": "0.19.1",
"lastProcessedHeight": 6690954,
"lastProcessedTimestamp": 1630819063745,
"uptime": 94.614984307,
"polkadotSdkVersion": "5.4.1",
"apiConnected": true,
"injectedApiConnected": true,
"usingDictionary": false,
"chain": "Polkadot",
"specName": "polkadot",
"genesisHash": "0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3",
"blockTime": 6000
}

/health

The health endpoint can be accessed via:

http://localhost:3000/meta

A healthy node will return a blank page which can be a little confusing. It actually returns an HTTP status of 200 OK so this should be used to determine if it is healthy or not.

If the node is not healthy, it will return a 500 status code. Typically you will see this when the node is starting up.

404

You will receive a 404 if the resource URL is incorrect.

1 thought on “How to check your SubQuery node health?

Leave a Reply

Your email address will not be published. Required fields are marked *