Skip to content

Commit d072876

Browse files
committed
build: move docker-compose config to project root directory
1 parent ecddaa5 commit d072876

File tree

3 files changed

+266
-0
lines changed

3 files changed

+266
-0
lines changed

.env.default

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# L1 network option: can be either `optimism`, `optimism-goerli`, `optimism-sepolia`, `base`, `base-goerli` or `base-sepolia`
2+
NETWORK=optimism
3+
4+
# The HTTP RPC endpoint of an L1 node
5+
L1_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/<API_KEY>
6+
7+
# The WebSocket RPC endpoint of an L1 node
8+
L1_WS_RPC_URL=wss://eth-mainnet.g.alchemy.com/v2/<API_KEY>
9+
10+
# The beacon chain RPC endpoint
11+
L1_BEACON_RPC_URL=
12+
13+
# The L1 signer private key
14+
L1_SIGNER=
15+
16+
# The batch inbox contract address deployed on l1
17+
BATCH_INBOX_ADDRESS=
18+
19+
# JWT secret for the engine API
20+
JWT_SECRET=bf549f5188556ce0951048ef467ec93067bc4ea21acebe46ef675cd4e8e015ff
21+
22+
# Execution client chain ID
23+
L2_CHAIN_ID=
24+
25+
# Execution client signer private key
26+
L2_SIGNER=
27+
28+
# Deployed l2 output oracle contract address
29+
L2OO_ADDRESS=
30+
31+
# Deployed l2 dispute game factory contract address
32+
L2DGF_ADDRESS=
33+
34+
# Execution client: can be either `op-geth` or `op-erigon`
35+
EXECUTION_CLIENT=op-geth
36+
37+
# The exeuction client Auth RPC port.
38+
EXECUTION_CLIENT_AUTH_RPC_PORT=8551
39+
40+
# The execution client RPC port.
41+
EXECUTION_CLIENT_RPC_PORT=8545
42+
43+
# The execution client WebSocket port.
44+
EXECUTION_CLIENT_WS_PORT=8546
45+
46+
# The Roll up client.
47+
ROLLUP_CLIENT=hildr-node
48+
49+
# The Roll up client RPC port.
50+
RPC_PORT=11545
51+
52+
# Sync mode: can be either `full` or `checkpoint`
53+
SYNC_MODE=full
54+
55+
# Only for `custom` or `devnet` network.
56+
# Specify the path to the `rollup.json` file generated by `op-node`.
57+
# For the devnet configuration, this file should be located in the `.devnet` folder within the Optimism directory.
58+
# OP_ROLLUP_JSON_FILEPATH=
59+
60+
# Only for `custom` or `devnet` network.
61+
# Specify the path to the `genesis-l2.json` file generated by `op-node`.
62+
# For the devnet configuration, this file should be located in the `.devnet` folder within the Optimism directory.
63+
# OP_GENESIS_JSON_FILEPATH=
64+
65+
# If the OP-Challenger should be run as a service alongside Magi
66+
# (comment out the next line if you don't want to run this service)
67+
#RUN_OP_CHALLENGER=run-op-challenger
68+
69+
# OP-Challenger mode: can be `listen-only` or `listen-and-respond`
70+
#OP_CHALLENGER_MODE=listen-only
71+
72+
73+
# ----------------- Only needed with `checkpoint` sync mode -----------------
74+
CHECKPOINT_SYNC_URL=https://opt-mainnet.g.alchemy.com/v2/<API_KEY>
75+
76+
77+
# ----- Only needed with the OP-Challenger in `listen-and-respond` mode -----
78+
#OP_CHALLENGER_SIGNER_KEY=a1742ee5f7898541224d6a91d9f3b34ad442e27bcb43223c01e47e58fc0a0c12
79+
80+
81+
# --------------------- Only needed for testing locally ---------------------
82+
L1_TEST_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/<API_KEY>
83+
L2_TEST_RPC_URL=https://opt-mainnet.g.alchemy.com/v2/<API_KEY>
84+
85+
86+
# ------------------------------ Do not modify ------------------------------
87+
COMPOSE_PROJECT_NAME=$NETWORK
88+
COMPOSE_PROFILES=hildr-node,metrics,${EXECUTION_CLIENT}
89+
90+
LOG_LEVEL=DEBUG

docker-compose.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
---
2+
version: "3.4"
3+
x-logging: &logging
4+
logging:
5+
driver: json-file
6+
options:
7+
max-size: 10m
8+
max-file: "3"
9+
10+
services:
11+
hildr-node:
12+
# image: ghcr.io/optimism-java/hildr:latest
13+
container_name: hildr-node
14+
build:
15+
dockerfile: ./docker/node.dock
16+
context: ./
17+
profiles:
18+
- hildr-node
19+
restart: unless-stopped
20+
stop_grace_period: 3m
21+
entrypoint: /scripts/start-hildr-node.sh
22+
depends_on:
23+
- op-geth
24+
env_file:
25+
- .env
26+
ports:
27+
- "9200:9200"
28+
- "${RPC_PORT}:${RPC_PORT}"
29+
volumes:
30+
- ./docker/:/scripts
31+
- data:/data
32+
- ${OP_ROLLUP_JSON_FILEPATH:-.}:/rollup.json
33+
<<: *logging
34+
35+
op-geth:
36+
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101315.1
37+
container_name: op-geth
38+
profiles:
39+
- op-geth
40+
restart: unless-stopped
41+
stop_grace_period: 3m
42+
entrypoint: /scripts/start-op-geth.sh
43+
env_file:
44+
- .env
45+
ports:
46+
- ${EXECUTION_CLIENT_AUTH_RPC_PORT}:8551
47+
- ${EXECUTION_CLIENT_RPC_PORT}:8545
48+
- ${EXECUTION_CLIENT_WS_PORT}:8546
49+
volumes:
50+
- ./docker/:/scripts
51+
- data:/data
52+
- ${OP_GENESIS_JSON_FILEPATH:-.}:/genesis-l2-attached.json
53+
<<: *logging
54+
55+
op-erigon:
56+
image: testinprod/op-erigon:latest
57+
container_name: op-erigon
58+
profiles:
59+
- op-erigon
60+
restart: unless-stopped
61+
stop_grace_period: 3m
62+
entrypoint: /scripts/start-op-erigon.sh
63+
env_file:
64+
- .env
65+
ports:
66+
- ${EXECUTION_CLIENT_AUTH_RPC_PORT}:8551
67+
- ${EXECUTION_CLIENT_RPC_PORT}:8545
68+
- ${EXECUTION_CLIENT_WS_PORT}:8546
69+
volumes:
70+
- ./docker/:/scripts
71+
- data:/data
72+
<<: *logging
73+
74+
op-challenger:
75+
image: merklefruit/op-challenger:latest
76+
container_name: op-challenger
77+
profiles:
78+
- challenger
79+
restart: unless-stopped
80+
stop_grace_period: 3m
81+
entrypoint: /scripts/start-op-challenger.sh
82+
env_file:
83+
- .env
84+
ports:
85+
- "9201:9201"
86+
volumes:
87+
- ./docker:/scripts
88+
- data:/data
89+
<<: *logging
90+
91+
prometheus:
92+
image: prom/prometheus:latest
93+
container_name: prometheus
94+
profiles:
95+
- metrics
96+
ports:
97+
- "9090:9090"
98+
command:
99+
- --config.file=/etc/prometheus/prometheus.yml
100+
volumes:
101+
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
102+
<<: *logging
103+
104+
node-exporter:
105+
image: prom/node-exporter:latest
106+
container_name: node-exporter
107+
profiles:
108+
- metrics
109+
restart: unless-stopped
110+
volumes:
111+
- /proc:/host/proc:ro
112+
- /sys:/host/sys:ro
113+
- /:/rootfs:ro
114+
command:
115+
- --path.procfs=/host/proc
116+
- --path.rootfs=/rootfs
117+
- --path.sysfs=/host/sys
118+
- --collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)
119+
expose:
120+
- 9100
121+
122+
grafana:
123+
image: grafana/grafana
124+
container_name: grafana
125+
profiles:
126+
- metrics
127+
ports:
128+
- "3000:3000"
129+
volumes:
130+
- ./grafana/provisioning/:/etc/grafana/provisioning/:ro
131+
environment:
132+
- GF_SECURITY_ADMIN_USER=hildr
133+
- GF_SECURITY_ADMIN_PASSWORD=passw0rd
134+
- GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH=/etc/grafana/provisioning/dashboards/dashboard.json
135+
136+
volumes:
137+
scripts:
138+
data:

docker/start-op-challenger.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/sh
2+
set -e
3+
4+
if [ $NETWORK = "optimism-goerli" ]
5+
then
6+
DISPUTE_GAME_FACTORY=0x000000000000000000000000000000000000dEaD # TODO: Update after deployment
7+
L2_OUTPUT_ORACLE=0xE6Dfba0953616Bacab0c9A8ecb3a9BBa77FC15c0
8+
elif [ $NETWORK = "base-goerli" ]
9+
then
10+
DISPUTE_GAME_FACTORY=0x000000000000000000000000000000000000dEaD # TODO: Update after deployment
11+
L2_OUTPUT_ORACLE=0x2A35891ff30313CcFa6CE88dcf3858bb075A2298
12+
else
13+
echo "Network not recognized. Available options are optimism-goerli and base-goerli"
14+
exit 1
15+
fi
16+
17+
if [ $OP_CHALLENGER_MODE = "listen-only" ]
18+
then
19+
exec op-challenger \
20+
--l1-ws-endpoint ${L1_WS_RPC_URL} \
21+
--trusted-op-node-endpoint http://magi:${RPC_PORT} \
22+
--dispute-game-factory $DISPUTE_GAME_FACTORY \
23+
--l2-output-oracle $L2_OUTPUT_ORACLE \
24+
--mode listen-only \
25+
-vv
26+
elif [ $OP_CHALLENGER_MODE = "listen-and-respond" ]
27+
then
28+
exec op-challenger \
29+
--l1-ws-endpoint ${L1_WS_RPC_URL} \
30+
--trusted-op-node-endpoint http://magi:${RPC_PORT} \
31+
--signer-key $OP_CHALLENGER_SIGNER_KEY \
32+
--dispute-game-factory $DISPUTE_GAME_FACTORY \
33+
--l2-output-oracle $L2_OUTPUT_ORACLE \
34+
--mode listen-and-respond \
35+
-vv
36+
else
37+
echo "Challenger mode not recognized. Available options are listen-only and listen-and-respond"
38+
fi

0 commit comments

Comments
 (0)