forked from AztecProtocol/aztec-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
218 lines (202 loc) · 6.62 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
name: aztec-devnet
services:
pxe:
image: aztecprotocol/aztec${AZTEC_DOCKER_TAG:-@sha256:03feac60e91f1aabf678cecbcd13271dda229120ec6007f2c1bac718ff550c70}
# need to run bb for proofs and bb is only built for x86
platform: linux/amd64
environment:
LOG_LEVEL: ${LOG_LEVEL:-info}
DEBUG: ${DEBUG:-aztec:*,-json-rpc:*,-aztec:circuits:artifact_hash,-aztec:randomness_singleton}
DEBUG_COLORS: 1
L1_CHAIN_ID: 31337
VERSION: 1
PXE_PROVER_ENABLED: ${PXE_PROVER_ENABLED:-1}
PXE_DATA_DIRECTORY: /var/lib/aztec/pxe
NODE_NO_WARNINGS: 1
AZTEC_PORT: 8080
entrypoint: >
sh -c '
export AZTEC_NODE_URL=$$(cat /var/run/secrets/aztec-node-url);
while ! curl --head --silent $AZTEC_NODE_URL > /dev/null; do echo "Node $$AZTEC_NODE_URL not up. Retrying after 1s"; sleep 1; done;
node /usr/src/yarn-project/aztec/dest/bin/index.js start --pxe
'
secrets:
- aztec-node-url
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- aztec:/var/lib/aztec
ports:
- 8080:8080/tcp
profiles:
- pxe
node:
image: aztecprotocol/aztec${AZTEC_DOCKER_TAG:-@sha256:03feac60e91f1aabf678cecbcd13271dda229120ec6007f2c1bac718ff550c70}
# need to run bb for proofs and bb is only built for x86
platform: linux/amd64
environment:
LOG_LEVEL: ${LOG_LEVEL:-info}
DEBUG: ${DEBUG:-aztec:*,-json-rpc:*,-aztec:circuits:artifact_hash,-aztec:randomness_singleton,-aztec:avm_simulator:*}
DEBUG_COLORS: 1
L1_CHAIN_ID: 31337
VERSION: 1
NODE_NO_WARNINGS: 1
PROVER_REAL_PROOFS: ${PROVER_REAL_PROOFS:-1}
DATA_DIRECTORY: /var/lib/aztec
PROVER_AGENT_ENABLED: 0
ROLLUP_CONTRACT_ADDRESS: "0x4ef7ca89e724a75ccca5dde7fb98075a388c2c91"
REGISTRY_CONTRACT_ADDRESS: "0x589a9634c1d00c62e47b3b7a790c8dc986b3d40d"
INBOX_CONTRACT_ADDRESS: "0x12d9b5effc69bf5c0c29c8258c6b6fa95a08de74"
OUTBOX_CONTRACT_ADDRESS: "0x3ec4b6c68a8c2ce4c78cdd465b3019b11a568d1d"
AVAILABILITY_ORACLE_CONTRACT_ADDRESS: "0x98a4089127f3f5d555656f1c9b1801342c9d6bce"
GAS_TOKEN_CONTRACT_ADDRESS: "0x73c43b919973711e096bfc04c9d4b3be511ffc0b"
GAS_PORTAL_CONTRACT_ADDRESS: "0xdf25b0a34dbee9f25518f7a4d63bab8b3bb3e496"
ETHEREUM_HOST:
P2P_TCP_LISTEN_ADDR: "0.0.0.0:9000"
P2P_UDP_LISTEN_ADDR: "0.0.0.0:9001"
P2P_TCP_ANNOUNCE_ADDR: ":9000"
P2P_UDP_ANNOUNCE_ADDR: ":9001"
P2P_QUERY_FOR_IP: true
P2P_ENABLED: true
PEER_ID_PRIVATE_KEY:
AZTEC_PORT: 8999
TEL_COLLECTOR_BASE_URL: ${TEL_COLLECTOR_BASE_URL:-http://otel-collector:4318}
secrets:
- ethereum-host
- p2p-boot-node
entrypoint: |
/bin/sh -c '
export ETHEREUM_HOST=$$(cat /var/run/secrets/ethereum-host)
export BOOTSTRAP_NODES=$$(cat /var/run/secrets/p2p-boot-node)
test -z "$$PEER_ID_PRIVATE_KEY" -a ! -f /var/lib/aztec/p2p-private-key && node /usr/src/yarn-project/cli/dest/bin/index.js generate-p2p-private-key | head -1 | cut -d" " -f 3 | tee /var/lib/aztec/p2p-private-key || echo "Re-using existing P2P private key"
test -z "$$PEER_ID_PRIVATE_KEY" && export PEER_ID_PRIVATE_KEY=$$(cat /var/lib/aztec/p2p-private-key)
# if the stack is started with --profile metrics --profile node, give the collector a chance to start before the node
i=0
max=3
while ! curl --head --silent $$TEL_COLLECTOR_BASE_URL > /dev/null; do
echo "OpenTelemetry collector not up. Retrying after 1s";
sleep 1;
i=$$((i+1));
if [ $$i -eq $$max ]; then
echo "OpenTelemetry collector at $$TEL_COLLECTOR_BASE_URL not up after $${max}s. Running without metrics";
unset TEL_COLLECTOR_BASE_URL;
break
fi;
done;
node /usr/src/yarn-project/aztec/dest/bin/index.js start --node --archiver
'
volumes:
- aztec:/var/lib/aztec
profiles:
- node
ports:
# the RPC endpoint - expose it on a different port to avoid conflicting with PXE
- 8999:8999/tcp
- 9000:9000/tcp
- 9001:9001/udp
cli:
image: aztecprotocol/aztec${AZTEC_DOCKER_TAG:-@sha256:03feac60e91f1aabf678cecbcd13271dda229120ec6007f2c1bac718ff550c70}
# run the same image as pxe
platform: linux/amd64
environment:
PXE_URL: http://pxe:8080
NODE_NO_WARNINGS: 1
PRIVATE_KEY:
ETHEREUM_HOST:
profiles:
- cli
otel-collector:
image: otel/opentelemetry-collector-contrib
configs:
- source: otel-collector-config
target: /etc/otelcol-contrib/config.yaml
profiles:
- metrics
ports:
- 4318:4318
prometheus:
image: prom/prometheus
profiles:
- metrics
configs:
- source: prometheus-config
target: /etc/prometheus/prometheus.yml
grafana:
image: grafana/grafana
ports:
- 3000:3000
profiles:
- metrics
volumes:
- ./grafana_dashboards:/etc/grafana/provisioning/dashboards
- grafana:/var/lib/grafana
configs:
- source: grafana-sources
target: /etc/grafana/provisioning/datasources/default.yml
jaeger:
image: jaegertracing/all-in-one
ports:
- 16686:16686
profiles:
- metrics
volumes:
aztec:
grafana:
configs:
grafana-sources:
content: |
apiVersion: 1
datasources:
- name: Prometheus
uid: aztec-node-metrics
type: prometheus
url: http://prometheus:9090
editable: false
isDefault: true
jsonData:
timeInterval: 10s
prometheus-config:
content: |
global:
evaluation_interval: 30s
scrape_interval: 10s
scrape_configs:
- job_name: otel-collector
static_configs:
- targets: ['otel-collector:8888']
- job_name: aztec
static_configs:
- targets: ['otel-collector:8889']
otel-collector-config:
content: |
receivers:
otlp:
protocols:
http:
processors:
batch:
exporters:
prometheus:
endpoint: 0.0.0.0:8889
metric_expiration: 5m
otlp/jaeger:
endpoint: "jaeger:4317"
tls:
insecure: true
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlp/jaeger]
metrics:
receivers: [otlp]
processors: [batch]
exporters: [prometheus]
secrets:
aztec-node-url:
environment: AZTEC_NODE_URL
ethereum-host:
environment: ETHEREUM_HOST
p2p-boot-node:
environment: BOOTSTRAP_NODES