Skip to content

Commit b87b055

Browse files
committed
Use a prebuilt op-node image
1 parent 321c0f0 commit b87b055

File tree

6 files changed

+23
-125
lines changed

6 files changed

+23
-125
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Thumbs.db
1919
# Environment variables
2020
.env
2121
.env.docker
22+
.env.playground
2223
/ui/.env
2324

2425
# Claude

crates/simulator/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
3232

3333
FROM debian:bookworm
3434

35-
RUN apt-get update && apt-get install -y libssl3 ca-certificates && rm -rf /var/lib/apt/lists/*
35+
RUN apt-get update && apt-get install -y libssl3 ca-certificates curl && rm -rf /var/lib/apt/lists/*
3636

3737
WORKDIR /app
3838

docker-compose.tips.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,16 @@ services:
5353
context: .
5454
dockerfile: crates/simulator/Dockerfile
5555
container_name: tips-simulator
56-
ports:
57-
# Listen on the loopback interface to fail fast if the ports are already in use by op-rbuilder
58-
- "127.0.0.1:2222:2222"
59-
- "127.0.0.1:4444:4444"
6056
volumes:
6157
- ${TIPS_SIMULATOR_DATADIR}:/data
6258
- ${TIPS_SIMULATOR_BUILDER_PLAYGROUND_DIR}:/playground
6359
env_file:
6460
- .env.docker
6561
restart: unless-stopped
62+
healthcheck:
63+
test: [ "CMD-SHELL", "[ \"$(curl -s -w '%{http_code}' -o /dev/null \"localhost:4444\")\" = \"401\" ]" ]
64+
interval: 10s
65+
timeout: 5s
66+
retries: 10
6667
profiles:
6768
- simulator

docker-compose.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,11 @@ services:
9292
"
9393
9494
simulator-cl:
95-
image: base-node-reth
95+
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:v1.13.7
9696
container_name: tips-simulator-cl
97+
depends_on:
98+
simulator:
99+
condition: service_healthy
97100
profiles:
98101
- simulator
99102
ports:
@@ -102,24 +105,7 @@ services:
102105
- "19222:9222/udp" # P2P UDP
103106
- "17300:7300" # metrics
104107
- "16060:6060" # pprof
105-
command:
106-
- bash
107-
- -c
108-
- |
109-
# builder-playground's op-node generates a new ENR for each run
110-
export OP_NODE_P2P_BOOTNODES=$(grep 'enr=' /artifacts/logs/op-node.log | sed -n 's/.*enr=\([^ ]*\).*/\1/p')
111-
112-
# Derived from op-node-entrypoint
113-
echo "Writing JWT secret to $${OP_NODE_L2_ENGINE_AUTH}"
114-
cat /data/jwtsecret > "$${OP_NODE_L2_ENGINE_AUTH}"
115-
eval "OP_NODE_L2_ENGINE_HTTP=\$${OP_NODE_L2_ENGINE_RPC/ws/http}"
116-
until [ "$(curl -s -w '%{http_code}' -o /dev/null "$${OP_NODE_L2_ENGINE_HTTP}")" -eq 401 ]; do
117-
echo "waiting for execution client to be ready"
118-
sleep 5
119-
done
120-
exec ./op-node
121108
volumes:
122-
- ~/.playground/devnet:/artifacts
123109
- ~/.playground/devnet/jwtsecret:/data/jwtsecret
124110
- ~/.playground/devnet/rollup.json:/data/rollup.json
125111
environment:
@@ -144,8 +130,8 @@ services:
144130

145131
# ENGINE CONFIGURATION
146132
OP_NODE_L2_ENGINE_KIND: reth
147-
OP_NODE_L2_ENGINE_RPC: ws://simulator:4444
148-
OP_NODE_L2_ENGINE_AUTH: /tmp/jwtsecret
133+
OP_NODE_L2_ENGINE_RPC: http://simulator:4444
134+
OP_NODE_L2_ENGINE_AUTH: /data/jwtsecret
149135

150136
# P2P CONFIGURATION
151137
OP_NODE_P2P_LISTEN_IP: 0.0.0.0
@@ -155,6 +141,8 @@ services:
155141
OP_NODE_P2P_ADVERTISE_IP: host.docker.internal
156142
OP_NODE_P2P_ADVERTISE_TCP: "19222"
157143
OP_NODE_P2P_ADVERTISE_UDP: "19222"
144+
# Only connect to the sequencer in playground mode
145+
OP_NODE_P2P_NO_DISCOVERY: "true"
158146

159147
# RPC CONFIGURATION
160148
OP_NODE_RPC_ADDR: 0.0.0.0
@@ -168,3 +156,5 @@ services:
168156
OP_NODE_METRICS_ADDR: 0.0.0.0
169157
OP_NODE_METRICS_PORT: "7300"
170158
STATSD_ADDRESS: "172.17.0.1"
159+
env_file:
160+
- .env.playground

docker/build-base-node-image.sh

Lines changed: 0 additions & 91 deletions
This file was deleted.

justfile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ stop-all profile="default":
4444
export COMPOSE_FILE=docker-compose.yml:docker-compose.tips.yml && docker compose --profile {{ profile }} down && docker compose --profile {{ profile }} rm && rm -rf data/
4545

4646
# Start every service running in docker, useful for demos
47-
start-all profile="default": (stop-all profile) ensure-base-node-image
47+
start-all profile="default": (stop-all profile)
4848
export COMPOSE_FILE=docker-compose.yml:docker-compose.tips.yml && mkdir -p data/postgres data/kafka data/minio && docker compose --profile {{ profile }} build && docker compose --profile {{ profile }} up -d
4949

5050
# Stop only the specified service without stopping the other services or removing the data directories
@@ -78,14 +78,6 @@ start-except programs: stop-all
7878

7979
export COMPOSE_FILE=docker-compose.yml:docker-compose.tips.yml && mkdir -p data/postgres data/kafka data/minio && docker compose build && docker compose up -d ${result_services[@]}
8080

81-
# Ensure the base-node-reth Docker image exists, building it if necessary
82-
ensure-base-node-image:
83-
#!/bin/bash
84-
if ! docker image inspect base-node-reth >/dev/null 2>&1; then
85-
echo "base-node-reth image not found, building it..."
86-
./docker/build-base-node-image.sh reth
87-
fi
88-
8981
### RUN SERVICES ###
9082
deps-reset:
9183
COMPOSE_FILE=docker-compose.yml:docker-compose.tips.yml docker compose down && docker compose rm && rm -rf data/ && mkdir -p data/postgres data/kafka data/minio && docker compose up -d
@@ -113,3 +105,8 @@ simulator-playground:
113105

114106
ui:
115107
cd ui && yarn dev
108+
109+
playground-env:
110+
echo "OP_NODE_P2P_BOOTNODES=$(grep 'enr=' ~/.playground/devnet/logs/op-node.log | sed -n 's/.*enr=\([^ ]*\).*/\1/p')" > .env.playground
111+
112+
start-playground: playground-env (start-all "simulator")

0 commit comments

Comments
 (0)