-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathzk-chains-docker-compose.yml
325 lines (289 loc) · 9.08 KB
/
zk-chains-docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# This docker compose is setting up the full ZK Chains network, consisting of:
#
# - L1 (reth) with explorer (blockscout)
# - a single postgres (with all the databases)
# - 2 zksync chains (with ids 271, 272) - 'master', 'custombase'
# - together with their explorers
# - hyperexplorer to merge it all together.
# Ports:
#
# - hyperexplorer: http://localhost:15000
# - l1 explorer: http://localhost:15001 (also using 15001, 15002, 15003)
# - l2 explorer: http://localhost:15005 (for all the chains)
# - L1 chain (reth): 15045
# - L2 chains (each next chain is +100 for ports)
# - 15100 - http
# - 15101 - ws
# - 15102 - explorer api
#
# So 15100 - 'master', 15200 - 'custombase'
# Database is on 15432
# pgAdmin to manage PostgreSQL DB is on 15430
services:
reth:
restart: always
image: "ghcr.io/paradigmxyz/reth:v0.2.0-beta.2"
volumes:
- type: bind
source: ./reth_chaindata
target: /chaindata
command: node --dev --datadir /rethdata --http --http.corsdomain "*" --http.addr 0.0.0.0 --http.port 8545 --dev.block-time 300ms --chain /chaindata/reth_config
environment:
- RUST_LOG=warn
ports:
- 127.0.0.1:15045:8545
- 8545:8545 # Make it accessible inside the network
postgres:
image: "postgres:14"
shm_size: 256m
# To create necessary databases for block explorer.
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
command: postgres -c 'max_connections=400'
ports:
- 127.0.0.1:15432:5432
environment:
# We bind only to 127.0.0.1, so setting insecure password is acceptable here
- POSTGRES_PASSWORD=notsecurepassword
pgadmin4:
image: dcagatay/pwless-pgadmin4:latest
ports:
- 127.0.0.1:15430:80
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: notsecurepassword
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
restart: unless-stopped
# Master node - that will create the ZK Chain
zksync:
stdin_open: true
tty: true
image: matterlabs/local-node:latest2.0_gateway
healthcheck:
test: curl --fail http://localhost:3071/health || exit 1
interval: 10s
timeout: 5s
retries: 200
start_period: 30s
volumes:
- shared_config:/etc/env/target
- shared_tokens:/etc/tokens
- shared_configs:/configs # ✅ Share /configs volume with other services
depends_on:
- reth
- postgres
ports:
- 127.0.0.1:15100:3050 # JSON RPC HTTP port
- 127.0.0.1:15101:3051 # JSON RPC WS port
- 127.0.0.1:15102:3071 # ✅ Expose health check port on host
environment:
- DATABASE_PROVER_URL=postgres://postgres:notsecurepassword@postgres/prover_local
- DATABASE_URL=postgres://postgres:notsecurepassword@postgres/zksync_local
- ETH_CLIENT_WEB3_URL=http://reth:8545
- LEGACY_BRIDGE_TESTING=1
zksync_custombase:
stdin_open: true
tty: true
image: matterlabs/local-node:latest2.0_gateway
depends_on:
reth:
condition: service_started
postgres:
condition: service_started
zksync:
condition: service_healthy
healthcheck:
test: curl --fail http://localhost:3171/health || exit 1
interval: 10s
timeout: 5s
retries: 200
start_period: 300s
volumes:
- shared_config:/etc/master_env
- shared_tokens:/etc/tokens:ro
- shared_configs:/configs # ✅ Mount /configs from zksync (era) into zksync_custombase
ports:
- 127.0.0.1:15200:3150 # JSON RPC HTTP port
- 127.0.0.1:15201:3151 # JSON RPC WS port
environment:
- DATABASE_PROVER_URL=postgres://postgres:notsecurepassword@postgres/prover_custombase
- DATABASE_URL=postgres://postgres:notsecurepassword@postgres/zksync_custombase
- ETH_CLIENT_WEB3_URL=http://reth:8545
- CHAIN_ETH_ZKSYNC_NETWORK_ID=271
- IN_DOCKER=true
- MASTER_URL=http://zksync:3050
- MASTER_HEALTH_URL=http://zksync:3071/health
- MASTER_ENV_FILE=/etc/master_env/dev.env
- CUSTOM_TOKEN_ADDRESS=${CUSTOM_TOKEN_ADDRESS}
data-fetcher_main:
platform: linux/amd64
image: "matterlabs/block-explorer-data-fetcher:latest"
environment:
- PORT=3040
- LOG_LEVEL=verbose
- NODE_ENV=development
- BLOCKCHAIN_RPC_URL=http://zksync:3050
restart: unless-stopped
data-fetcher_custombase:
platform: linux/amd64
image: "matterlabs/block-explorer-data-fetcher:latest"
environment:
- PORT=3040
- LOG_LEVEL=verbose
- NODE_ENV=development
- BLOCKCHAIN_RPC_URL=http://zksync_custombase:3050
restart: unless-stopped
worker_main:
platform: linux/amd64
image: "matterlabs/block-explorer-worker:latest"
environment:
- PORT=3001
- LOG_LEVEL=verbose
- NODE_ENV=development
- DATABASE_HOST=postgres
- DATABASE_USER=postgres
- DATABASE_PASSWORD=notsecurepassword
- DATABASE_NAME=block-explorer
- BLOCKCHAIN_RPC_URL=http://zksync:3050
- DATA_FETCHER_URL=http://data-fetcher_main:3040
- BATCHES_PROCESSING_POLLING_INTERVAL=1000
restart: unless-stopped
worker_custombase:
platform: linux/amd64
image: "matterlabs/block-explorer-worker:latest"
environment:
- PORT=3001
- LOG_LEVEL=verbose
- NODE_ENV=development
- DATABASE_HOST=postgres
- DATABASE_USER=postgres
- DATABASE_PASSWORD=notsecurepassword
- DATABASE_NAME=block-explorer_custombase
- BLOCKCHAIN_RPC_URL=http://zksync_custombase:3050
- DATA_FETCHER_URL=http://data-fetcher_custombase:3040
- BATCHES_PROCESSING_POLLING_INTERVAL=1000
restart: unless-stopped
api_main:
platform: linux/amd64
image: "matterlabs/block-explorer-api:latest"
environment:
- PORT=3020
- METRICS_PORT=3005
- LOG_LEVEL=verbose
- NODE_ENV=development
- DATABASE_URL=postgres://postgres:notsecurepassword@postgres:5432/block-explorer
ports:
- '127.0.0.1:15103:3020'
depends_on:
- worker_main
restart: unless-stopped
api_custombase:
platform: linux/amd64
image: "matterlabs/block-explorer-api:latest"
environment:
- PORT=3020
- METRICS_PORT=3005
- LOG_LEVEL=verbose
- NODE_ENV=development
- DATABASE_URL=postgres://postgres:notsecurepassword@postgres:5432/block-explorer_custombase
ports:
- '127.0.0.1:15202:3020'
depends_on:
- worker_custombase
restart: unless-stopped
app:
platform: linux/amd64
image: "matterlabs/block-explorer-app:latest"
volumes:
# This is super hacky - we should have a better solution.
- ./explorer_mapping.js:/usr/src/app/packages/app/dist/assets/dev.config.4e99e047.js
ports:
- '127.0.0.1:15005:3010'
depends_on:
- api_main
- api_custombase
restart: unless-stopped
## Blockscout
redis-db:
image: 'redis:alpine'
command: redis-server
backend:
depends_on:
- postgres
- redis-db
image: blockscout/blockscout:latest
restart: always
stop_grace_period: 5m
command: sh -c "bin/blockscout eval \"Elixir.Explorer.ReleaseTasks.create_and_migrate()\" && bin/blockscout start"
env_file:
- blockscout/common-blockscout.env
links:
- postgres:database
environment:
- ETHEREUM_JSONRPC_VARIANT=geth
- DATABASE_URL=postgresql://postgres:notsecurepassword@postgres:5432/blockscout
- ETHEREUM_JSONRPC_HTTP_URL=http://reth:8545
- ETHEREUM_JSONRPC_TRACE_URL=http://reth:8545
ports:
- "127.0.0.1:4000:4000"
frontend:
depends_on:
- backend
image: ghcr.io/blockscout/frontend:latest
platform: linux/amd64
restart: always
env_file:
- blockscout/common-frontend.env
stats:
depends_on:
- backend
image: ghcr.io/blockscout/stats:latest
platform: linux/amd64
restart: always
env_file:
- blockscout/common-stats.env
environment:
- STATS__BLOCKSCOUT_API_URL=http://backend:4000
- STATS__DB_URL=postgresql://postgres:notsecurepassword@postgres:5432/blockscout_stats
- STATS__BLOCKSCOUT_DB_URL=postgresql://postgres:notsecurepassword@postgres:5432/blockscout
- STATS__CREATE_DATABASE=true
- STATS__RUN_MIGRATIONS=true
proxy:
depends_on:
- backend
- frontend
- stats
image: nginx
volumes:
- "./blockscout/proxy:/etc/nginx/templates"
environment:
BACK_PROXY_PASS: http://backend:4000
FRONT_PROXY_PASS: http://frontend:3000
ports:
- target: 80
published: 15001
- target: 8080
published: 15002
- target: 8081
published: 15003
sig-provider:
image: ghcr.io/blockscout/sig-provider:latest
platform: linux/amd64
restart: always
hyperexplorer:
depends_on:
zksync:
condition: service_healthy
zksync_custombase:
condition: service_healthy
image: ghcr.io/mm-zk/zksync_tools:latest
ports:
- 127.0.0.1:15000:5000
volumes:
- ./hyperexplorer.json:/app/operator/config.json
volumes:
reth:
shared_config:
shared_tokens:
shared_configs: # ✅ Shared volume for /configs