mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add ethereum-metrics-exporter (#3573)
Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
e7cedee411
commit
64ca521458
@ -80,23 +80,36 @@ To run Reth with Docker Compose, run the following command from a shell inside t
|
||||
|
||||
```bash
|
||||
./etc/generate-jwt.sh
|
||||
docker compose -f etc/docker-compose.yml up -d
|
||||
docker compose -f etc/docker-compose.yml -f etc/lighthouse.yml up -d
|
||||
```
|
||||
|
||||
> **Note**
|
||||
>
|
||||
> If you want to run Reth with a CL that is not Lighthouse:
|
||||
>
|
||||
> - The JWT for the consensus client can be found at `etc/jwttoken/jwt.hex` in this repository, after the `etc/generate-jwt.sh` script is run
|
||||
> - The Reth Engine API is accessible on `localhost:8551`
|
||||
|
||||
To check if Reth is running correctly, run:
|
||||
|
||||
```bash
|
||||
docker compose logs -f reth
|
||||
```
|
||||
|
||||
The default `docker-compose.yml` file will create four containers:
|
||||
The default `docker-compose.yml` file will create three containers:
|
||||
|
||||
- Reth
|
||||
- Prometheus
|
||||
- Grafana
|
||||
- Lighthouse
|
||||
|
||||
Grafana will be exposed on `localhost:3000` and accessible via default credentials (username and password is `admin`)
|
||||
The optional `lighthouse.yml` file will create two containers:
|
||||
|
||||
- Lighthouse
|
||||
- [`ethereum-metrics-exporter`](https://github.com/ethpandaops/ethereum-metrics-exporter)
|
||||
|
||||
Grafana will be exposed on `localhost:3000` and accessible via default credentials (username and password is `admin`), with two available dashboards:
|
||||
- reth
|
||||
- Ethereum Metrics Exporter (works only if Lighthouse is also running)
|
||||
|
||||
## Interacting with Reth inside Docker
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@ services:
|
||||
- '9001:9001' # metrics
|
||||
- '30303:30303' # eth/66 peering
|
||||
- '8545:8545' # rpc
|
||||
- '8551:8551' # engine
|
||||
volumes:
|
||||
- rethdata:/root/.local/share/reth/mainnet/db
|
||||
- rethlogs:/root/rethlogs
|
||||
@ -22,29 +23,7 @@ services:
|
||||
--authrpc.port 8551
|
||||
--authrpc.jwtsecret /root/jwt/jwt.hex
|
||||
--http --http.addr 0.0.0.0 --http.port 8545
|
||||
--http.api "eth,net"
|
||||
|
||||
lighthouse:
|
||||
restart: unless-stopped
|
||||
image: sigp/lighthouse
|
||||
depends_on:
|
||||
- reth
|
||||
ports:
|
||||
- '5052:5052/tcp'
|
||||
- '5053:5053/tcp'
|
||||
- '5054:5054/tcp' # metrics
|
||||
- '9000:9000/tcp'
|
||||
- '9000:9000/udp'
|
||||
volumes:
|
||||
- lighthousedata:/root/.lighthouse
|
||||
- ./jwttoken:/root/jwt:ro
|
||||
command: >
|
||||
lighthouse bn
|
||||
--http --http-address 0.0.0.0
|
||||
--execution-endpoint http://reth:8551
|
||||
--metrics --metrics-address 0.0.0.0
|
||||
--execution-jwt /root/jwt/jwt.hex
|
||||
--checkpoint-sync-url https://mainnet.checkpoint.sigp.io
|
||||
--http.api "eth,net,web3"
|
||||
|
||||
prometheus:
|
||||
restart: unless-stopped
|
||||
@ -87,8 +66,6 @@ volumes:
|
||||
driver: local
|
||||
rethlogs:
|
||||
driver: local
|
||||
lighthousedata:
|
||||
driver: local
|
||||
prometheusdata:
|
||||
driver: local
|
||||
grafanadata:
|
||||
|
||||
12
etc/ethereum-metrics-exporter/config.yaml
Normal file
12
etc/ethereum-metrics-exporter/config.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
consensus:
|
||||
enabled: true
|
||||
url: "http://lighthouse:5052"
|
||||
name: "consensus-client"
|
||||
execution:
|
||||
enabled: true
|
||||
url: "http://reth:8545"
|
||||
name: "execution-client"
|
||||
modules:
|
||||
- "eth"
|
||||
- "net"
|
||||
- "web3"
|
||||
@ -1,4 +1,11 @@
|
||||
# Borrowed from EthStaker's prepare for the merge guide
|
||||
# See https://github.com/remyroy/ethstaker/blob/main/prepare-for-the-merge.md#configuring-a-jwt-token-file
|
||||
mkdir -p jwttoken
|
||||
openssl rand -hex 32 | tr -d "\n" | tee > jwttoken/jwt.hex
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
mkdir -p ${SCRIPT_DIR}/jwttoken
|
||||
if [[ ! -f ${SCRIPT_DIR}/jwttoken/jwt.hex ]]
|
||||
then
|
||||
openssl rand -hex 32 | tr -d "\n" | tee > ${SCRIPT_DIR}/jwttoken/jwt.hex
|
||||
else
|
||||
echo "${SCRIPT_DIR}/jwttoken/jwt.hex already exists!"
|
||||
fi
|
||||
3578
etc/grafana/dashboards/metrics-exporter.json
Normal file
3578
etc/grafana/dashboards/metrics-exporter.json
Normal file
File diff suppressed because it is too large
Load Diff
44
etc/lighthouse.yml
Normal file
44
etc/lighthouse.yml
Normal file
@ -0,0 +1,44 @@
|
||||
version: '3.9'
|
||||
name: reth
|
||||
|
||||
services:
|
||||
|
||||
lighthouse:
|
||||
restart: unless-stopped
|
||||
image: sigp/lighthouse
|
||||
depends_on:
|
||||
- reth
|
||||
ports:
|
||||
- '5052:5052/tcp' # rpc
|
||||
- '5053:5053/tcp'
|
||||
- '5054:5054/tcp' # metrics
|
||||
- '9000:9000/tcp' # p2p
|
||||
- '9000:9000/udp' # p2p
|
||||
volumes:
|
||||
- lighthousedata:/root/.lighthouse
|
||||
- ./jwttoken:/root/jwt:ro
|
||||
command: >
|
||||
lighthouse bn
|
||||
--http --http-address 0.0.0.0
|
||||
--execution-endpoint http://reth:8551
|
||||
--metrics --metrics-address 0.0.0.0
|
||||
--execution-jwt /root/jwt/jwt.hex
|
||||
--checkpoint-sync-url https://mainnet.checkpoint.sigp.io
|
||||
|
||||
metrics-exporter:
|
||||
restart: unless-stopped
|
||||
image: ethpandaops/ethereum-metrics-exporter:debian-latest
|
||||
depends_on:
|
||||
- reth
|
||||
- lighthouse
|
||||
ports:
|
||||
- 9091:9091 # metrics
|
||||
volumes:
|
||||
- ./ethereum-metrics-exporter/config.yaml:/root/config.yaml
|
||||
command:
|
||||
- --config=/root/config.yaml
|
||||
- --metrics-port=9091
|
||||
|
||||
volumes:
|
||||
lighthousedata:
|
||||
driver: local
|
||||
@ -3,4 +3,9 @@ scrape_configs:
|
||||
metrics_path: "/"
|
||||
scrape_interval: 5s
|
||||
static_configs:
|
||||
- targets: ['reth:9001']
|
||||
- targets: ['reth:9001']
|
||||
- job_name: ethereum-metrics-exporter
|
||||
metrics_path: "/metrics"
|
||||
scrape_interval: 5s
|
||||
static_configs:
|
||||
- targets: ['metrics-exporter:9091']
|
||||
Reference in New Issue
Block a user