Set up a monitoring solution for tracking Ethereum validator balances using Prometheus for data storage, a custom Python exporter for fetching data from the beaconcha.in API, and Grafana for visualization.
conda create --name staking_dashboard python=3.10
conda activate staking_dashboard
Install necessary packages:
conda install requests pandas
conda install -c conda-forge influxdb-client
See code for python_exporter.py in the repo
python python_exporter.py
Download from https://prometheus.io/download/ Version: prometheus-2.51.0.linux-amd64.tar.gz
Open the prometheus.yml file and update the scrape config:
scrape_configs:
- job_name: 'python_exporter'
honor_timestamps: false
static_configs:
- targets: ['localhost:8000']
Run Prometheus (for linux: ./prometheus --config.file=prometheus.yml)
Access Prometheus at http://localhost:9090
Download from https://grafana.com/grafana/download Version: grafana-enterprise-10.4.1.linux-amd64.tar.gz Run grafana (for linux: ./bin/grafana-server)
Access Grafana at http://localhost:3000 and log in(default is admin/admin)
Add Prometheus as a data source through Grafana's UI: Configuration > Data Sources > Add data source > Prometheus. Set the URL to http://localhost:9090.
Create a dashboard and panel for visualizing the validator balance. Use the query validator_balance{validator_id="237172"}.
Install InfluxDB Installed influxdb from the website https://github.com/influxdata/influxdb/releases/tag/v2.7.5 version installed: influxdb2_2.7.5-1_amd64.deb
- Check status if its running: sudo systemctl status influxdb
- If its not running, you can start with: sudo systemctl start influxdb
- Enable influxdb on startup: sudo systemctl enable influxdb
org = StakeMax bucket = stake-poc