Monitor the health of a Near validator deployment with alerts like:
First, set the addresses you'd like to monitor in addresses.<network>.yaml
and set your node and alerting envars in .env-<network>
.
Then, develop this project locally with:
# Setup
yarn
# Test
yarn test
# Run locally
ENV_FILE=.env-template yarn dev
Monitors can be enabled or disabled by commenting out desired monitors in src/monitor/monitor.ts
. Default monitors include:
The monitor can be containerized and readied for deploy like so. The container will listen on $PORT
(default: 8080) and run anytime a request hits it. It's intended for deployment in a container management system with a job set to contact it every ~60 seconds to initiate a new run of the monitor.
docker build -t monitor .
docker run monitor