Monitoring delegations and rewards as a validator of ShipChain

Hilbi
Shipchain (un) Official Community
2 min readNov 11, 2020

This will be a short and straightforward tutorial on how to set up a script and monitoring the output in Grafana.

Firstly, follow shipmateFRnl’s guide on how to set up Grafana, Telegraf, and InfluxDB here.

My full script for monitoring your delegations and rewards is posted here. An alternative to my script if you have multiple wallets, is the script of ShipChainEurope which can be downloaded here. However, it uses different paths as me, so you’d have to edit it accordingly. To install my script, follow the commands posted here one by one:

  • $ mkdir ./filedump/ Here we make a directory where all text and JSON files will be generated because we don't want to clog our working directory.
  • $ nano ./filedump/stakerewards.sh and copy and paste the script here. Then press CTRL+\ to find & replace user with your own username. Press CTRL+O to save the file and then CTRL+X to exit the text editor.
  • Make the script executable by running the command $ chmod +x ./filedump/stakerewards.sh
  • Now run the command crontab -e and then copy-paste the following at the bottom of the file */30 * * * * /home/user/filedump/stakerewards.sh and by replacing user with your own username.
    This will cause the script the run every 30 minutes.

Configuring Telegraf

  • Copy-paste this at the bottom of your Telegraf configuration file.
    $ sudo nano /etc/telegraf/telegraf.conf then press CTRL+\ to find & replace user with your own username. Press CTRL+O to save the file and then CTRL+X to exit the text editor.
  • $ sudo systemctl restart telegraf to restart the Telegraf service.
  • $ sudo systemctl status telegraf to verify there are no errors.

Configuring Grafana

  • Install Farksi Blenstat panel with $ sudo grafana-cli plugins install farski-blendstat-panel
  • Restart Grafana $ sudo systemctl restart grafana-server
  • Now go to the Grafana page in your web browser on your desktop, something like IP-address:3000if you didn't change your default port yet. There we will import the following JSON that can be downloaded here. How the other inputs are generated that are used in this dashboard will be covered in a future post. Alternatively, you can add and configure the panels from this tutorial yourself in an existing dashboard.

If you successfully followed all steps, you should see all rewards, delegations, and their current market price in Grafana.

--

--