Skip to content

Commit

Permalink
Fix compose file configuration for node-validator and block-explorer
Browse files Browse the repository at this point in the history
Fix docker-compose and process-compose for node-validator

The `node-validator` section of the `docker-compose.yaml` file has the environment variable
`ESPRESSO_NODE_VALIDATOR_INITIAL_NODE_PUBLIC_BASE_URLS` pointing at the incorrect
ports for all of the sequencers that are not `sequencer0`.  As a result, the other sequencers are
not correctly scraped and are not reflected in the data collected.  Additionally, the port that the
`node-validator` is meant to expose is not being forwarded to the container via the environment
variable `ESPRESSO_NODE_VALIDATOR_PORT`.  Finally, the local demo service doesn't produce
any visible logs while running.

Forwards the relevant needed environment variables for logging, and modifies the the ports in
the node public base URLs to correct the issue.

Add node validator configuration to process-compose and docker-compose

The block-explorer now has support for the node validator API, but has not been updated to point
to the relevant base URL for the service.  As a result, the Nodes Page will still generate fake data.

Updates the process-compose.yaml and docker-compose.yaml configuration to supply the
environment variable `NODE_VALIDATOR_URI` so that it points to the `node-validator` as a
websocket connection.
  • Loading branch information
Ayiga committed Aug 8, 2024
1 parent e52425a commit eb7422e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 6 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -662,9 +662,12 @@ services:
ports:
- "$ESPRESSO_NODE_VALIDATOR_PORT:$ESPRESSO_NODE_VALIDATOR_PORT"
environment:
- RUST_LOG
- RUST_LOG_FORMAT
- ESPRESSO_NODE_VALIDATOR_PORT
- ESPRESSO_NODE_VALIDATOR_STAKE_TABLE_SOURCE_BASE_URL=http://sequencer0:$ESPRESSO_SEQUENCER_API_PORT/v0/
- ESPRESSO_NODE_VALIDATOR_LEAF_STREAM_SOURCE_BASE_URL=http://sequencer0:$ESPRESSO_SEQUENCER_API_PORT/v0/
- ESPRESSO_NODE_VALIDATOR_INITIAL_NODE_PUBLIC_BASE_URLS=http://sequencer0:$ESPRESSO_SEQUENCER_API_PORT,http://sequencer1:$ESPRESSO_SEQUENCER1_API_PORT,http://sequencer2:$ESPRESSO_SEQUENCER2_API_PORT,http://sequencer3:$ESPRESSO_SEQUENCER3_API_PORT,http://sequencer4:$ESPRESSO_SEQUENCER4_API_PORT
- ESPRESSO_NODE_VALIDATOR_INITIAL_NODE_PUBLIC_BASE_URLS=http://sequencer0:$ESPRESSO_SEQUENCER_API_PORT/,http://sequencer1:$ESPRESSO_SEQUENCER_API_PORT/,http://sequencer2:$ESPRESSO_SEQUENCER_API_PORT/,http://sequencer3:$ESPRESSO_SEQUENCER_API_PORT/,http://sequencer4:$ESPRESSO_SEQUENCER_API_PORT/
depends_on:
sequencer0:
condition: service_healthy
Expand Down Expand Up @@ -733,7 +736,8 @@ services:
ports:
- "$ESPRESSO_BLOCK_EXPLORER_PORT:3000"
environment:
- QUERY_SERVICE_URI:http://localhost:$ESPRESSO_SEQUENCER1_API_PORT/v0/
- QUERY_SERVICE_URI=http://localhost:$ESPRESSO_SEQUENCER1_API_PORT/v0/
- NODE_VALIDATOR_URI=ws://localhost:$ESPRESSO_NODE_VALIDATOR_PORT/v0/
depends_on:
sequencer1:
condition: service_healthy
7 changes: 4 additions & 3 deletions process-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ environment:
- ESPRESSO_DEMO_L1_HTTP_PROVIDER=$ESPRESSO_SEQUENCER_L1_PROVIDER
- ESPRESSO_STATE_RELAY_SERVER_URL=http://localhost:$ESPRESSO_STATE_RELAY_SERVER_PORT
- QUERY_SERVICE_URI=http://localhost:$ESPRESSO_SEQUENCER1_API_PORT/v0/
- NODE_VALIDATOR_URI=ws://localhost:$ESPRESSO_NODE_VALIDATOR_PORT/v0/
processes:
# Cheating a bit here but since we don't usually have to debug go-ethereum
# it's using the docker compose service which is a bit easier.
Expand Down Expand Up @@ -338,11 +339,11 @@ processes:
failure_threshold: 100

node_validator:
command: node-metrics --
command: RUST_LOG=debug node-metrics --
environment:
- ESPRESSO_NODE_VALIDATOR_STAKE_TABLE_SOURCE_BASE_URL=http://localhost:$ESPRESSO_SEQUENCER_API_PORT/v0/
- ESPRESSO_NODE_VALIDATOR_LEAF_STREAM_SOURCE_BASE_URL=http://localhost:$ESPRESSO_SEQUENCER_API_PORT/v0/
- ESPRESSO_NODE_VALIDATOR_INITIAL_NODE_PUBLIC_BASE_URLS=http://localhost:$ESPRESSO_SEQUENCER_API_PORT,http://localhost:$ESPRESSO_SEQUENCER1_API_PORT,http://localhost:$ESPRESSO_SEQUENCER2_API_PORT,http://localhost:$ESPRESSO_SEQUENCER3_API_PORT,http://localhost:$ESPRESSO_SEQUENCER4_API_PORT
- ESPRESSO_NODE_VALIDATOR_INITIAL_NODE_PUBLIC_BASE_URLS=http://localhost:$ESPRESSO_SEQUENCER_API_PORT/,http://localhost:$ESPRESSO_SEQUENCER1_API_PORT/,http://localhost:$ESPRESSO_SEQUENCER2_API_PORT/,http://localhost:$ESPRESSO_SEQUENCER3_API_PORT/,http://localhost:$ESPRESSO_SEQUENCER4_API_PORT/
depends_on:
broker_0:
condition: process_healthy
Expand Down Expand Up @@ -656,7 +657,7 @@ processes:

block-explorer:
command:
docker run --rm -p $ESPRESSO_BLOCK_EXPLORER_PORT:3000 -e QUERY_SERVICE_URI
docker run --rm -p $ESPRESSO_BLOCK_EXPLORER_PORT:3000 -e QUERY_SERVICE_URI -e NODE_VALIDATOR_URI
ghcr.io/espressosystems/espresso-block-explorer:main
depends_on:
sequencer1:
Expand Down

0 comments on commit eb7422e

Please sign in to comment.