git clone https://github.com/w3f/polkadot-watcher.git
cd polkadot-watcher
cp config/main.sample.yaml config/main.yaml
#just the first time
yarn
yarn build
yarn start
The watcher is a nodeJs application meant to be connected with a substrate based node through a web socket.
It can then monitor the status of the node, leveraging on mechanisms such as the builtin heartbeat.
- A validator has been reported for Slash
- A validator is not seleceted by Phragmen alorithm to be part of the active set
- A validator has changed his payout address destination
- A validator has an unexpected payout address destination
- A validator has changed his commission rate
- A validator has an unexpected commission rate
Possible Payout Destination Types are 'Staked' | 'Stash' | 'Controller' | 'Account' | 'None'
.
If an expected destination address is specified in the config file, it is implicit that you are expecting a type 'Account'
to be matched.
- session: https://wiki.polkadot.network/docs/en/glossary#session
- era: https://wiki.polkadot.network/docs/en/glossary#era
- polkadotJs library (raccomended, Nodejs + typescript): https://polkadot.js.org/docs/
- event, validator SlashReported: https://polkadot.js.org/docs/substrate/events/#slashreportedaccountid32-perbill-u32
A sample config file is provided here
The list of your addresses can be dynamically retrieved (app startup/restart) from a Git file. Check the GitConfigLoader implementation.
A Prometheus instance can be attached to this application thanks to the endpoint exposed at /metrics.
An Alerting system can be then built on top of that, see here
The Dockerfile can be deployed into a Kubernetes cluster thanks to the polkadot-watcher chart.