Skip to content

Altishofer/ConsensusObserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lighthouse Prometheus InfluxDB Telegraf Grafana

Lighthouse Dashboard

Real-time blockchain monitoring and analytics for Ethereum consensus properties using Lighthouse, Prometheus, InfluxDB v3, Telegraf, and Grafana. Developed for the course "Blockchain Programming" at University of Zurich using the official UZH ETH PoS Node.



Overview

This project provides a real-time blockchain monitoring dashboard to analyze Lighthouse's consensus properties. It integrates Lighthouse's Prometheus metrics with a full monitoring stack:

Key Technologies

Technology Role
Lighthouse Ethereum consensus layer client providing validator metrics
Prometheus Scrapes blockchain metrics and provides time-series data
InfluxDB v3 High-performance time-series database
Telegraf Ingests Prometheus metrics and forwards them to InfluxDB
Grafana Provides real-time visualization of blockchain metrics

Deployment Guide

1. Clone the Repository

git clone https://gitlab.uzh.ch/sandrinraphael.hunkeler/blockchainseminar.git
cd blockchainseminar

2. Set Up Secrets

2.1 Create secret files:

mkdir -p secrets
touch secrets/.env.influxdb3-api-token
touch secrets/.env.wallet-address

2.2 Store influxdb3 token:

# Open secret file
nano secrets/.env.influxdb3-api-token
# Insert valid (but insecure) api-token
apiv3_2ueuF0QKTzyXivh5wIshOllJk1mdstJDZ3h2XNho88rSgUWElA9a2yYQ1X56kUOXlaTk_R425EaScVPwMsCitQ
# OR (optional) generate one *after* deploying influxdb
docker exec -it influxdb3 bash
influxdb3 create token
# Copy token and insert it into secret file
# Requires restart of telegraf container

2.3 Store Ethereum wallet address:

# Open secret file
# Insert valid ethereum wallet address 0x4f...
nano secrets/.env.wallet-address

3. Install Dependencies

3.1 Update System Packages

sudo apt update && sudo apt upgrade -y

3.2 Install Docker

3.3 Start Docker

sudo systemctl enable containerd.service
sudo systemctl start docker

3.4 Build Docker Images

docker compose build

Caution

If you are on a Apple Silicon Mac, change the following lines in the docker-compose.yml and eth-node Dockerfile:

Add platform in docker-compose.yml:

 eth-node:
    build: eth-node
    platform: linux/amd64 # <-- add this
    container_name: eth-node

Change tag in eth-node/Dockerfile:

FROM amd64/ubuntu:22.04 # instead of FROM ubuntu:latest

4. Start All Services

docker compose up

4.1 Verify Prometheus Endpoint

curl -s http://localhost:5052/metrics | head -n 20

4.2 Check if output in the following format

async_tasks_count{async_task_count="fork_choice_advance"} 0
async_tasks_count{async_task_count="http-api"} 1


6. Accessing Monitoring Interfaces

Service URL
Grafana http://localhost:3000
InfluxDB http://localhost:8086

6.1 Remote Access

For remote virtual machines, the ports must be forwarded to the localhost.


7 Service Management Commands

Start All Services

docker compose up -d

Stop All Services

docker compose down

View Logs

docker compose logs -f

Restart a Service

docker compose restart <service_name>

Debug Build Process

docker compose build --no-cache --progress=plain

Clean Up Unused Docker Cache

docker system prune -a --volumes -f

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published