Giter Club home page Giter Club logo

half-life's Introduction

HalfLife

HalfLife is a Cosmos-based blockchain validator monitoring and alerting utility

Monitors and alerts for scenarios such as:

  • Slashing period uptime
  • Recent missed blocks (is the validator signing currently)
  • Jailed status
  • Tombstoned status
  • Individual sentry nodes unreachable/out of sync
  • Chain halted

Discord messages are created in the configured webhook channel for:

  • Current validator status
  • Detected alerts

Quick start

Install Go

Go is necessary in order to install halflife.

# install
wget https://golang.org/dl/go1.18.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.18.2.linux-amd64.tar.gz

# source go
cat <<EOF >> ~/.profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF
source ~/.profile
go version

Install halflife binary

cd ~/half-life
go install

Setup config.yaml

Copy config.yaml.example to config.yaml and populate with your discord and validator information. You can optionally provide the sentries array to also monitor the sentries via grpc. rpc-retries can optionally be provided to override the default of 5 RPC retries before alerting, useful for congested RPC servers. fullnode can be set to true to only monitor reachable and out of sync for the provided sentries. address is not required when fullnode is true.

See here for how to create a webhook for a discord channel.

Once you've created the webhook, copy the URL. It'll look something like this: https://discord.com/api/webhooks/978129125394247720/cwM4Ks-kWcK3Jsg4I_cboauYjOa48ngI2VKaS76afsMwuY7-U4Frw3BGcYXCJvZJ2kWD

This will be used later to be put into the config.yaml. The webhook id is 978129125394247720 (from the URL), and webhook token is cwM4Ks-kWcK3Jsg4I_cboauYjOa48ngI2VKaS76afsMwuY7-U4Frw3BGcYXCJvZJ2kWD

Save the values as follows (note these values are from the URL):

webhook:
  id: 978129125394247720
  token: cwM4Ks-kWcK3Jsg4I_cboauYjOa48ngI2VKaS76afsMwuY7-U4Frw3BGcYXCJvZJ2kWD

Start monitoring

Begin monitoring with:

halflife monitor

By default, half-life monitor will look for config.yaml in the current working directory. To specify a different config file path, use the --file/-f flag:

halflife monitor -f ~/config.yaml

When a validator is first added to config.yaml and halflife is started, a status message will be created in the discord channel and the ID of that message will be added to config.yaml. Pin this message so that the channel's pinned messages can act as a dashboard to see the realtime status of the validators.

Screenshot from 2022-02-28 14-29-36

Alerts will be posted when any error conditions are detected, and follow up messages will be posted when those errors are cleared.

Screenshot from 2022-02-16 10-53-43

For high and critical errors, the configured discord user IDs will be tagged

Screenshot from 2022-02-16 11-38-00

half-life's People

Contributors

agouin avatar de-husk avatar boojamya avatar dylanschultzie avatar mark-rushakoff avatar pfc-developer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.