- Cosmos Validator Watcher is set to streamline monitoring and interaction with Cosmos-based blockchains and validators by Kiln.
- This custom tool does not allow you to receive data from the blockchain in real time and distribute it to the watcher.
- Therefore, our team create pars_script which adds active validators to the watcher configuration in real time.
- The script collects data from the
x/stakingAPI module and the/validatorsRPC.
watcheras default username and password
Import the GPG key for Grafana:
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -Add the Grafana repository to the APT sources:
sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"Update the package lists:
sudo apt updateInstall the Grafana:
sudo apt install grafanaStart and enable service:
sudo systemctl start grafana-server
sudo systemctl enable grafana-serverCheck status grafana-server:
sudo systemctl status grafana-server- If everything works fine, enter your
Public IP:3000in searchbar. You will see the login page:adminas default username and password.
Install go:
sudo apt-get install -y snapd
sudo snap install go --classic
sudo apt install makeBuild cosmos-validator-watcher:
git clone https://github.com/kilnfi/cosmos-validator-watcher
cd cosmos-validator-watcher
git checkout v0.14.0
make build
cd build
mv cosmos-validator-watcher /usr/local/bin/git clone https://github.com/endorphinestake/story-validator-watcherapt install python3-pippip install vk_api
pip install schedulecd story-validator-watcher/pars_script
python3 main.pyTo run in the background, use screen:
rm -rf $HOME/story-validator-watcher/pars_script/rpc.db
screen -S main
cd pars_script
python3 main.pyDownload Prometheus:
sudo wget https://github.com/prometheus/prometheus/releases/download/v2.47.0/prometheus-2.47.0.linux-amd64.tar.gzExtract Files:
sudo tar vxf prometheus*.tar.gzCreate a user for prometeus:
sudo groupadd --system prometheus
sudo useradd -s /sbin/nologin --system -g prometheus prometheusCreate directories for prometheus:
sudo mkdir /etc/prometheus
sudo mkdir /var/lib/prometheus
cd prometheus*/Move the binary files:
sudo mv prometheus /usr/local/bin
sudo mv promtool /usr/local/bin
sudo mv console* /etc/prometheus
sudo mv prometheus.yml /etc/prometheusSet owner:
sudo chown prometheus:prometheus /usr/local/bin/prometheus
sudo chown prometheus:prometheus /usr/local/bin/promtool
sudo chown prometheus:prometheus /etc/prometheus
sudo chown -R prometheus:prometheus /etc/prometheus/consoles
sudo chown -R prometheus:prometheus /etc/prometheus/console_libraries
sudo chown -R prometheus:prometheus /var/lib/prometheusChange config:
sudo nano /etc/prometheus/prometheus.ymlglobal:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'watcher'
static_configs:
- targets: ['localhost:8080'] # Adjust the target to your node exporter endpoint
- job_name: 'story node'
static_configs:
- targets: ['135.181.208.245:26660'] # Adjust the target to your story node exporter endpointCreate prometeus service:
sudo nano /etc/systemd/system/prometheus.service[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target
[Service]
User=prometheus
Group=prometheus
Type=simple
ExecStart=/usr/local/bin/prometheus \
--config.file /etc/prometheus/prometheus.yml \
--storage.tsdb.path /var/lib/prometheus/ \
--web.console.templates=/etc/prometheus/consoles \
--web.console.libraries=/etc/prometheus/console_libraries
[Install]
WantedBy=multi-user.targetStart and enable service:
sudo systemctl daemon-reload
sudo systemctl enable prometheus
sudo systemctl start prometheus-
If everything works fine, enter your
Public IP:3000in searchbar. You will see the login page:adminas default username and password. -
Click
Dashboard-New-Import.
- Download json for Grafana dashboard.
- Click
Upload dashboard JSON fileand drop here your file.
- Be sure to specify the data source -
prometheus-1and clickImport.
- Completed, if everything is done correctly, your dashboard will start displaying data.
- By default, script scans the API every 3 seconds. You can change this:
nano $HOME/story-validator-watcher/pars_script/main.pyschedule.every(1).seconds.do(main)
schedule.every(1).minutes.do(main)
schedule.every(1).hours.do(main)
schedule.every(1).days.do(main)
schedule.every(1).weeks.do(main) - You must clear the database before each restart
parse_script:
rm -rf $HOME/story-validator-watcher/pars_script/rpc.db- To add multiple RPC to watcher:
nano $HOME/story-validator-watcher/pars_script/parse/get_subprocess_link.py- Edit API for parse_script:
nano $HOME/story-validator-watcher/pars_script/parse/parse.pyYou can download the Grafana dashboard here:
watcher as default username and password







