ergo icon indicating copy to clipboard operation
ergo copied to clipboard

Need simple API call to verify if node is "Active Synchronization" or "Node is synced"

Open vinnielima opened this issue 2 years ago • 9 comments

In summary, need an API call such as "/healthcheck" that provides a simple text response that reflects the status of a node synchronization with the blockchain.

I operate over 14 nodes globally for GetBlok.io. It is unsurmountable that at this maturity of the reference client, it is still consistently running into synchronization problems with the blockchain. When operating a global mining pool, we cannot afford to have a node fall out of sync.

Typically, this type of failure in the infrastructure is handled through health probes. The problem is that the Ergo reference client node does not facilitate such checks by industry standard load balancers.

Most applications offer an API endpoint that simply returns a text indicating a such condition (OK, UNHEALTHY, etc). This is because most GLB/ELBs do not provide complex mechanisms for calculations (such as current height vs blockchain height). It simply provides an ability to check for 404, 200, etc HTTP return codes, as well as reasonable parsing of the returned body of the GET request.

As many know, you cannot assume your Ergo node is health by simply being "online".

Thus, the request here is simple: Provide an unauthenticated API endpoint call that reports if a node is synchronized, or actively synchronizing. This will allow many pool operators to perform such healthcheck and pull a node out of a load balanced back end.

vinnielima avatar Jun 27 '22 00:06 vinnielima