-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
371 lines (351 loc) · 10.3 KB
/
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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
version: "3"
networks:
nffl:
name: nffl
driver: bridge
# internal: true
# enable_ipv6: false
services:
rmq:
image: rabbitmq:3-management-alpine
container_name: rmq
user: rabbitmq
ports:
- "5672:5672"
- "15672:15672"
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
healthcheck:
test: rabbitmq-diagnostics check_port_connectivity
interval: 1s
timeout: 3s
retries: 30
networks:
- nffl
mainnet-anvil:
image: ghcr.io/foundry-rs/foundry:latest@sha256:8b843eb65cc7b155303b316f65d27173c862b37719dc095ef3a2ef27ce8d3c00
container_name: mainnet-anvil
ports:
- "8545:8545"
entrypoint: anvil
volumes:
- ./tests/anvil/data/avs-and-eigenlayer-deployed-anvil-state.json:/root/.anvil/state.json
command: --host 0.0.0.0 --port 8545 --chain-id 1 --block-time 5 --load-state /root/.anvil/state.json
healthcheck:
test: ["CMD", "nc", "-zv", "0.0.0.0", "8545"]
interval: 15s
timeout: 10s
retries: 5
networks:
- nffl
mainnet-anvil-setup:
image: ghcr.io/foundry-rs/foundry:latest@sha256:8b843eb65cc7b155303b316f65d27173c862b37719dc095ef3a2ef27ce8d3c00
container_name: mainnet-anvil-setup
depends_on:
mainnet-anvil:
condition: service_healthy
entrypoint: sh
command:
- -c
- |
cast rpc anvil_setBalance 0xD5A0359da7B310917d7760385516B2426E86ab7f 0x8ac7230489e80000
cast rpc anvil_setBalance 0x9441540E8183d416f2Dc1901AB2034600f17B65a 0x8ac7230489e80000
environment:
- ETH_RPC_URL=http://mainnet-anvil:8545
networks:
- nffl
rollup0-anvil:
image: ghcr.io/foundry-rs/foundry:latest@sha256:8b843eb65cc7b155303b316f65d27173c862b37719dc095ef3a2ef27ce8d3c00
container_name: rollup0-anvil
ports:
- "8546:8546"
entrypoint: anvil
volumes:
- ./tests/anvil/data/rollup-avs-deployed-anvil-state.json:/root/.anvil/state.json
command: --host 0.0.0.0 --port 8546 --chain-id 2 --block-time 5 --load-state /root/.anvil/state.json
healthcheck:
test: ["CMD", "nc", "-zv", "0.0.0.0", "8546"]
interval: 15s
timeout: 10s
retries: 5
networks:
- nffl
rollup0-relayer:
image: nffl-test-relayer:latest
container_name: rollup0-relayer
depends_on:
rollup0-anvil:
condition: service_healthy
near-da-deploy:
condition: service_completed_successfully
expose:
- 9091
volumes:
- near_cli_keys:/root/.near-credentials
command:
- run-args
- --rpc-url
- ws://rollup0-anvil:8546
- --da-account-id
- da2.test.near
- --key-path
- /root/.near-credentials/localnet/da2.test.near.json
- --network
- http://nffl-indexer:3030
- --metrics-ip-port-address
- rollup0-relayer:9091
networks:
- nffl
rollup1-anvil:
image: ghcr.io/foundry-rs/foundry:latest@sha256:8b843eb65cc7b155303b316f65d27173c862b37719dc095ef3a2ef27ce8d3c00
container_name: rollup1-anvil
ports:
- "8547:8547"
entrypoint: anvil
volumes:
- ./tests/anvil/data/rollup-avs-deployed-anvil-state.json:/root/.anvil/state.json
command: --host 0.0.0.0 --port 8547 --chain-id 3 --block-time 5 --load-state /root/.anvil/state.json
healthcheck:
test: ["CMD", "nc", "-zv", "0.0.0.0", "8547"]
interval: 2s
timeout: 30s
retries: 15
networks:
- nffl
rollup1-relayer:
image: nffl-test-relayer:latest
container_name: rollup1-relayer
depends_on:
rollup1-anvil:
condition: service_healthy
near-da-deploy:
condition: service_completed_successfully
expose:
- 9091
volumes:
- near_cli_keys:/root/.near-credentials
- ./config-files:/etc/relayer
command:
- run-config
- --path
- /etc/relayer/relayer1-docker-compose.yaml
networks:
- nffl
indexer-setup:
image: debian:bookworm
container_name: nffl-indexer-setup
volumes:
- near_cli_data:/near-cli
- near_cli_keys:/root/.near-credentials
entrypoint: sh
command:
- -c
- |
rm -rf /near-cli/*
rm -rf /root/.near-credentials/*
networks:
- nffl
indexer:
image: nffl-indexer:latest
container_name: nffl-indexer
depends_on:
rmq:
condition: service_healthy
mainnet-anvil-setup:
condition: service_completed_successfully
indexer-setup:
condition: service_completed_successfully
ports:
- "3030:3030"
expose:
- 9090 # prometheus port
volumes:
- near_cli_data:/root/.near
- near_cli_keys:/root/.near-credentials
command:
- --rmq-address
- amqp://rmq:5672
- --da-contract-ids
- da2.test.near
- --da-contract-ids
- da3.test.near
- --rollup-ids
- "2"
- --rollup-ids
- "3"
- --metrics-ip-port-address
- "0.0.0.0:9090"
networks:
- nffl
near-da-deploy:
image: node:16
container_name: nffl-near-da-deploy
depends_on:
indexer:
condition: service_healthy
volumes:
- ./:/nffl/
- near_cli_data:/near-cli
- near_cli_keys:/root/.near-credentials
entrypoint: sh
command:
- -c
- |
npm i -g [email protected]
near create-account da2.test.near --masterAccount test.near
near deploy da2.test.near /nffl/tests/near/near_da_blob_store.wasm --initFunction new --initArgs {} --masterAccount test.near -f
near create-account da3.test.near --masterAccount test.near
near deploy da3.test.near /nffl/tests/near/near_da_blob_store.wasm --initFunction new --initArgs {} --masterAccount test.near -f
environment:
- NEAR_ENV=localnet
- NEAR_CLI_LOCALNET_NETWORK_ID=localnet
- NEAR_HELPER_ACCOUNT=near
- NEAR_CLI_LOCALNET_KEY_PATH=/near-cli/validator_key.json
- NEAR_NODE_URL=http://nffl-indexer:3030
networks:
- nffl
aggregator:
image: nffl-aggregator
container_name: nffl-aggregator
depends_on:
mainnet-anvil-setup:
condition: service_completed_successfully
expose:
- 9091
volumes:
- ./:/nffl/
working_dir: /nffl
command:
- --config
- config-files/aggregator-docker-compose.yaml
- --nffl-deployment
- contracts/evm/script/output/31337/sffl_avs_deployment_output.json
- --ecdsa-private-key
- "0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6"
networks:
- nffl
aggregator-health:
image: debian:bookworm
depends_on:
aggregator:
condition: service_started
command: sh -c "apt update && apt install -y netcat-traditional && sleep infinity"
healthcheck:
test: ["CMD", "nc", "-zv", "nffl-aggregator", "9091"]
interval: 15s
timeout: 10s
retries: 5
networks:
- nffl
operator0:
image: nffl-operator
container_name: nffl-operator0
depends_on:
rmq:
condition: service_healthy
mainnet-anvil-setup:
condition: service_completed_successfully
aggregator:
condition: service_started
expose:
- 9090 # prometheus metrics port (defined in operator0-docker-compose.anvil.yaml file)
volumes:
- ./:/nffl/
working_dir: /nffl
environment:
- OPERATOR_BLS_KEY_PASSWORD=fDUMDLmBROwlzzPXyIcy
- OPERATOR_ECDSA_KEY_PASSWORD=EnJuncq01CiVk9UbuBYl
command: --config config-files/operator0-docker-compose.anvil.yaml
networks:
- nffl
operator0-health:
image: debian:bookworm
depends_on:
operator0:
condition: service_started
command: sh -c "apt update && apt install -y netcat-traditional && sleep infinity"
healthcheck:
test: ["CMD", "nc", "-zv", "nffl-operator0", "9090"]
interval: 15s
timeout: 10s
retries: 5
networks:
- nffl
operator1:
image: nffl-operator
container_name: nffl-operator1
depends_on:
operator0-health:
condition: service_healthy
expose:
- 9091 # prometheus metrics port (defined in operator1-docker-compose.anvil.yaml file)
volumes:
- ./:/nffl/
working_dir: /nffl
environment:
- OPERATOR_BLS_KEY_PASSWORD=2EVEUyHCrHZdfdo8lp29
- OPERATOR_ECDSA_KEY_PASSWORD=isru1gvtykIavuk1Fg1Q
command: --config config-files/operator1-docker-compose.anvil.yaml
networks:
- nffl
operator1-health:
image: debian:bookworm
depends_on:
operator1:
condition: service_started
command: sh -c "apt update && apt install -y netcat-traditional && sleep infinity"
healthcheck:
test: ["CMD", "nc", "-zv", "nffl-operator1", "9091"]
interval: 15s
timeout: 10s
retries: 5
networks:
- nffl
# METRICS RELATED
grafana:
image: grafana/grafana:9.4.1
container_name: grafana
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning:/etc/grafana/provisioning
environment:
# See https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#override-configuration-with-environment-variables
# and https://grafana.com/docs/grafana/latest/setup-grafana/configure-docker/
# They recommend using env vars instead of overwriting config.ini
- GF_SECURITY_ADMIN_USER=${ADMIN_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
restart: unless-stopped
ports:
- 3000:3000
networks:
- nffl
prometheus:
image: prom/prometheus:v2.42.0
container_name: prometheus
volumes:
- ./prometheus:/etc/prometheus
- prometheus_data:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/etc/prometheus/console_libraries"
- "--web.console.templates=/etc/prometheus/consoles"
- "--storage.tsdb.retention.time=200h"
- "--web.enable-lifecycle"
- --web.enable-remote-write-receiver
restart: unless-stopped
ports:
- 9090:9090
networks:
- nffl
# so that we can access the host from within the container
# needed to get the metrics from host.docker.internal:9184/metrics
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
prometheus_data:
grafana_data:
near_cli_data:
near_cli_keys: