githubEdit

Validator Status API

Use the Validator Status API to query a validator's status, such as whether it is losing blocks, on cheqd.

Summary

We built a network-wide validator status monitoring tool that will send out alerts in case your node starts losing blocks. Join/follow the #mainnet-alertsarrow-up-right channel to get these updates.

How it works/how we built it

  1. Our block explorer (BigDipper)arrow-up-right exposes a GraphQL endpoint. This GraphQL endpoint is what the block explorer front-end uses when showing validator conditions on the overall/per-validator pagearrow-up-right.

  2. To simplify parsing the output from the GraphQL endpoint, we did a simple wrapper using Cloudflare Workers to parse the GraphQL outputarrow-up-right into simple JSON.

Alerting

To simplify the task of alerting via various channels (and to keep it extensible to other channels), we take the output of our validator status API and parse it via Zapierarrow-up-right. This is done as a two-stage process via two separate “Zaps”.

  1. Collating a list of validators missing blocks

  2. Schedule by Zapierarrow-up-right to wake up the “Zap” every hour

  3. Run custom JavaScript code using Code by Zapierarrow-up-right to parse the JSON output

  4. Filter by Zapierarrow-up-right to check if there are entries generated in the compromised validator list. If not, then terminate Zap execution.

  5. If the execution has reached this stage, Looping by Zapierarrow-up-right with the following sub-steps:

  6. Formatter by Zapierarrow-up-right to carry out text/number formatting.

  7. Digest by Zapierarrow-up-right to push the formatted bullet-list item with validator details into a compiled digest.

  8. Sending an alert to designated alert channel: A separate Zap triggers and sends alerts to designated channels. Right now, our setup sends these details to the cheqd Community Slackarrow-up-right and the cheqd Community Discordarrow-up-right.

  9. Similar to above, Schedule by Zapier to wake the Zap up every hour

  10. “Release” any unreleased digests by using the manual release feature in Digest by Zapierarrow-up-right.

  11. Filter by Zapier to check if there are any entries populated in the digest. If not, terminate execution of any further steps at this stage.

  12. If execution has proceeded to this step, use the Zapier App for Slackarrow-up-right and Zapier App for Discordarrow-up-right to send a message (with formatting) to designated alert channels.

You can copy this Zap to configure a similar setup for other alert channels, such as SMS by Zapierarrow-up-right or Email by Zapierarrow-up-right.

Last updated

Was this helpful?