Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cheqd/validator-status

Network-wide validator status alerting API for cheqd mainnet. Designed to work for any Cosmos SDK network
https://github.com/cheqd/validator-status

bigdipper cheqd cloudflare-workers cosmos-sdk hacktoberfest zapier

Last synced: about 1 month ago
JSON representation

Network-wide validator status alerting API for cheqd mainnet. Designed to work for any Cosmos SDK network

Awesome Lists containing this project

README

        

# Cosmos SDK: Validator Status Alerts API

[![GitHub license](https://img.shields.io/github/license/cheqd/validator-status?color=blue&style=flat-square)](https://github.com/cheqd/validator-status/blob/main/LICENSE)
[![GitHub contributors](https://img.shields.io/github/contributors/cheqd/validator-status?label=contributors%20%E2%9D%A4%EF%B8%8F&style=flat-square)](https://github.com/cheqd/validator-status/graphs/contributors)

[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/cheqd/.github/dispatch.yml?label=workflows&style=flat-square)](https://github.com/cheqd/validator-status/actions/workflows/dispatch.yml) ![GitHub repo size](https://img.shields.io/github/repo-size/cheqd/validator-status?style=flat-square)

## ℹī¸ Overview

Most validator status reporting software in [Cosmos SDK](https://cosmos.network/) is designed to be run *directly* by a node operator to monitor their own nodes. This typically pulls data from [the Tendermint Prometheus metrics sink](https://docs.tendermint.com/v0.34/tendermint-core/metrics.html) exposed on a node.

We wanted to build a way to monitor the status of validator nodes *globally* across the cheqd mainnet, and raise alerts in case validator nodes were losing blocks. (Validator nodes [can get jailed if they miss too many blocks](https://docs.cosmos.network/main/modules/slashing/) and their stake slashed.)

This custom API pulls data for all validator nodes from [a BigDipper block explorer](https://explorer.cheqd.io/) (e.g., [explorer.cheqd.io](https://explorer.cheqd.io/)) and repurposes/wraps [the validator condition results](https://explorer.cheqd.io/validators) into a JSON array.

The API itself can be deployed using [Cloudflare Workers](https://workers.cloudflare.com/) or compatible serverless platforms. Alerting is then achieved using Zapier (a low-code/no-code automation platform) to pipe these alerts to Slack, Discord, etc.

## 🚨 Alerting via Zapier

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 [Zapier](https://zapier.com/). This is done as a two-stage process via two separate "Zaps".

Right now, our setup sends these details to the [cheqd Community Slack](http://cheqd.link/join-cheqd-slack) and the [cheqd Community Discord](http://cheqd.link/discord-github).

1. Our validator status API sends [a webhook call to a Zapier "Zap"](https://zapier.com/shared/d407b10516f89da18e35b97ce3ef226bca2ad741) that listens for newly-degraded validators every hour.
2. Lists of degraded validators are compiled using a Zapier "Sub-Zap" to process the data from the API into a usable format and stored in a "digest".

```javascript
const body = JSON.parse(inputData.VALIDATOR_CONDITION);
var degraded = [];

for (let k=0; k