December 22, 2022

Monitoring and notifying the OKP4 node using Tenderduty v2.

An important step for a validator of any network is to set up monitoring and notification of the node!!! Thus, OKP4 validators must be constantly online and sign blocks to ensure network security. In case of long-term skipping of blocks in the OKP4 network, validators are punished by burning the delegation share, being deprived of the opportunity to vote for future blocks for a certain period of time and lack of rewards.

Any monitoring tool is based on a data collector that collects and stores up-to-date information from a controlled system, in our case it is an OKP4 node. The information is presented in the form of an information panel that can be tracked manually. For more convenient interaction, alerts are configured automatically!!! There are rules that the validator must follow, in case of violation of the rules, an alert is automatically sent

To monitor OKP4, a comprehensive Tendermint - Tenderduty network monitoring tool will be used. The updated V2 version adds a web dashboard, prometheus exporter, telegram and discord notifications, support for multiple chains, more detailed alerts and other types of alerts.

Installation:

Updating packages:

sudo apt update && sudo apt upgrade -y

Install the necessary utilities:

sudo apt install curl build-essential git wget jq make gcc tmux -y

Installing docker:

sudo apt update && \
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && \
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" && \
sudo apt update && \
apt-cache policy docker-ce && \
sudo apt install docker-ce -y

Create a folder and install Tenderduty:

mkdir tenderduty && cd tenderduty 
docker run --rm ghcr.io/blockpane/tenderduty:latest -example-config >config.yml

Open the configuration file and change the desired values:

nano $HOME/tenderduty/config.yml

save ctrl O, enter, ctrl X

Launching tenderduty:

docker run -d --name tenderduty -p "8888:8888" -p "28686:28686" --restart unless-stopped -v $(pwd)/config.yml:/var/lib/tenderduty/config.yml ghcr.io/blockpane/tenderduty:latest

Checking the logs:

docker logs -f --tail 20 tenderduty

We find out the address and paste it into the browser to view the information :

echo -e "\033[0;32mhttp://$(wget -qO- eth0.me):8888/\033[0m"

Setting up an alert:

creating a server in discord (we do as indicated in the screenshots below):

Copy the webhook URL, go to the configuration file, change the value to yes and paste our link:

Restarting tenderduty:

docker restart tenderduty

To check, you can restart the node: