forked from stratum-mining/benchmarking-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-config-c.yaml
523 lines (495 loc) · 13.9 KB
/
docker-compose-config-c.yaml
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
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
volumes:
prometheus_data_config_c:
grafana_data_config_c:
bitcoin_pool_side_data:
bitcoin_sv1_pool_side_data:
shared-mainnet-snapshot-volume:
networks:
monitor-net:
sv2-net:
driver: bridge
ipam:
config:
- subnet: 10.5.0.0/24
gateway: 10.5.0.1
services:
common-template-provider-builder:
build:
dockerfile: ./template-provider.dockerfile
container_name: common-template-provider-builder
image: template-provider-builder-image
command: echo "common-template-provider build completed"
sv2-roles-builder:
build:
dockerfile: ./sv2-roles.dockerfile
container_name: sv2-roles-builder
image: sv2-roles-builder-image
command: echo "SRI build completed"
sv2-custom-proxy-builder:
build:
dockerfile: ./sv2-custom-proxy/Dockerfile
container_name: sv2-custom-proxy-builder
image: sv2-custom-proxy-builder-image
command: echo "sv2-custom-proxy build completed"
sv1-custom-proxy-builder:
build:
dockerfile: ./sv1-custom-proxy/Dockerfile
container_name: sv1-custom-proxy-builder
image: sv1-custom-proxy-builder-image
command: echo "sv1-custom-proxy build completed"
log-server-builder:
build:
dockerfile: ./log-server/Dockerfile
container_name: log-server-builder
image: log-server-builder-image
command: echo "log-server-builder build completed"
pools-latency-calculator-builder:
build:
dockerfile: pools-latency-calculator.dockerfile
container_name: pools-latency-calculator-builder
image: pools-latency-calculator-builder-image
command: echo "pools-latency-calculator build completed"
template-provider-pool-side:
labels:
logging: "config-c"
image: template-provider-builder-image
entrypoint: ["/bin/sh", "-c", "./scripts/update-mainnet-chainstate.sh ${NETWORK} && /bitcoin/bin/bitcoind -sv2 -sv2port=8442 -sv2interval=${SV2_INTERVAL} -sv2feedelta=0 -debug=sv2 -loglevel=sv2:debug -sv2bind=0.0.0.0 -${NETWORK}"]
ports:
- "8442:8442"
- "18333:48333"
- "8332:8332"
- "18332:18332"
container_name: sv2-tp-pool-side
depends_on:
- common-template-provider-builder
volumes:
- bitcoin_pool_side_data:/root/.bitcoin
- shared-mainnet-snapshot-volume:/shared_volume # Shared volume for mainnet snapshot
- ./custom-configs/sri-roles/bitcoin-tp-pool.conf:/root/.bitcoin/bitcoin.conf
- ./containers-scripts:/scripts
restart: unless-stopped
networks:
sv2-net:
ipv4_address: 10.5.0.2
healthcheck:
test: [ "CMD", "./scripts/healthcheck.sh", "http://127.0.0.1:18332" ]
interval: 2m
timeout: 30s
retries: 100
start_period: 1m
sv1-node-pool-side:
labels:
logging: "config-c"
image: template-provider-builder-image
entrypoint: ["/bin/sh", "-c", "./scripts/update-mainnet-chainstate.sh ${NETWORK} && /bitcoin/bin/bitcoind -${NETWORK}"]
ports:
- "38333:18333"
- "28332:18332"
- "18443:18443"
container_name: sv1-node-pool-side
depends_on:
- common-template-provider-builder
volumes:
- bitcoin_sv1_pool_side_data:/root/.bitcoin
- shared-mainnet-snapshot-volume:/shared_volume # Shared volume for mainnet snapshot
- ./custom-configs/sri-roles/bitcoin-sv1-node-pool.conf:/root/.bitcoin/bitcoin.conf
- ./containers-scripts:/scripts
restart: unless-stopped
networks:
sv2-net:
ipv4_address: 10.5.0.16
environment:
- NETWORK=${NETWORK}
healthcheck:
test: [ "CMD", "./scripts/healthcheck.sh", "http://127.0.0.1:18332" ]
interval: 2m
timeout: 30s
retries: 100
start_period: 1m
pool:
image: sv2-roles-builder-image
labels:
logging: "config-c"
command:
[
"./target/release/pool_sv2",
"-c",
"pool/config-examples/pool-config-c-docker-example.toml",
]
ports:
- "34254:34254"
container_name: sv2-pool
depends_on:
- sv2-roles-builder
- sv2-tp-pool-proxy
volumes:
- ./custom-configs/sri-roles/config-c:/usr/src/stratum/roles/pool/config-examples/
restart: unless-stopped
networks:
sv2-net:
ipv4_address: 10.5.0.4
cap_add:
- NET_ADMIN
translator:
image: sv2-roles-builder-image
labels:
logging: "config-c"
command:
[
"/bin/bash",
"-c",
"/usr/local/bin/monitor_and_apply_latency.sh 10.5.0.23 2 & exec ./target/release/translator_sv2 -c translator/config-examples/tproxy-config-c-docker-example.toml",
]
ports:
- "34256:34256"
container_name: sv2-translator
depends_on:
- sv2-pool-translator-proxy
volumes:
- ./custom-configs/sri-roles/config-c:/usr/src/stratum/roles/translator/config-examples/
restart: unless-stopped
networks:
sv2-net:
ipv4_address: 10.5.0.7
cap_add:
- NET_ADMIN
sv2-pool-translator-proxy:
image: sv2-custom-proxy-builder-image
labels:
logging: "config-c"
command:
[
"/bin/bash",
"-c",
"/usr/local/bin/monitor_and_apply_latency.sh 10.5.0.4 2 -proxy-type=pool-translator & exec ./target/release/sv2-custom-proxy",
]
ports:
- "34253:34254"
- "34251:34251"
- "3456:3456"
environment:
- SERVER=10.5.0.4:34254
- CLIENT=10.5.0.17:34251
- PROM_ADDRESS=10.5.0.17:3456
- PROXY_TYPE=pool-translator
container_name: sv2-pool-translator-proxy
depends_on:
- sv2-custom-proxy-builder
- pool
restart: unless-stopped
networks:
sv2-net:
ipv4_address: 10.5.0.17
cap_add:
- NET_ADMIN
sv2-tp-pool-proxy:
image: sv2-custom-proxy-builder-image
labels:
logging: "config-c"
command: ["./target/release/sv2-custom-proxy"]
ports:
- "8441:8441"
- "5678:5678"
environment:
- SERVER=10.5.0.2:8442
- CLIENT=10.5.0.20:8441
- PROM_ADDRESS=10.5.0.20:5678
- PROXY_TYPE=tp-pool
- NETWORK=${NETWORK}
container_name: sv2-tp-pool-proxy
depends_on:
template-provider-pool-side:
condition: service_healthy
restart: true
sv2-custom-proxy-builder:
condition: service_started
prometheus:
condition: service_started
restart: unless-stopped
networks:
sv2-net:
ipv4_address: 10.5.0.20
sv2-translator-miner-proxy:
image: sv1-custom-proxy-builder-image
labels:
logging: "config-c"
command: ["./target/release/sv1-custom-proxy"]
ports:
- "34255:34255"
- "5676:5676"
environment:
- SERVER=0.0.0.0:34255
- CLIENT=10.5.0.7:34256
- PROM_ADDRESS=10.5.0.23:5676
- PROXY_TYPE=translator-miner
container_name: sv2-translator-miner-proxy
depends_on:
- sv1-custom-proxy-builder
- translator
restart: unless-stopped
networks:
sv2-net:
ipv4_address: 10.5.0.23
sv1-pool:
container_name: sv1-pool
labels:
logging: "config-c"
build:
context: .
dockerfile: ./sv1-public-pool.dockerfile
ports:
- "3332:3332"
- "3334:3334"
volumes:
- "./testnet-DB:/public-pool/DB"
- "./custom-configs/sv1-pool/.env:/public-pool/.env:ro"
- "./custom-configs/sv1-pool/rpc.js:/public-pool/node_modules/rpc-bitcoin/build/src/rpc.js" # to fix rpc-version field issue
restart: unless-stopped
environment:
- NODE_ENV=production
depends_on:
- sv1-node-pool-proxy
networks:
sv2-net:
ipv4_address: 10.5.0.8
cap_add:
- NET_ADMIN
sv1-pool-miner-proxy:
image: sv1-custom-proxy-builder-image
labels:
logging: "config-c"
command:
[
"/bin/bash",
"-c",
"/usr/local/bin/monitor_and_apply_latency.sh 10.5.0.8 2 & exec ./target/release/sv1-custom-proxy",
]
ports:
- "3333:3333"
- "2345:2345"
environment:
- SERVER=10.5.0.8:3332
- CLIENT=0.0.0.0:3333
- PROM_ADDRESS=10.5.0.19:2345
- PROXY_TYPE=pool-miner
container_name: sv1-pool-miner-proxy
depends_on:
- sv1-custom-proxy-builder
- sv1-pool
restart: unless-stopped
networks:
sv2-net:
ipv4_address: 10.5.0.19
cap_add:
- NET_ADMIN
sv1-node-pool-proxy:
image: sv1-custom-proxy-builder-image
labels:
logging: "config-c"
command: ["./target/release/sv1-custom-proxy"]
ports:
- "48330:48330"
- "4567:4567"
environment:
- SERVER=http://10.5.0.16:18332
- CLIENT=0.0.0.0:48330
- PROM_ADDRESS=10.5.0.21:4567
- PROXY_TYPE=node-pool
container_name: sv1-node-pool-proxy
depends_on:
sv1-custom-proxy-builder:
condition: service_started
sv1-node-pool-side:
condition: service_healthy
restart: true
restart: unless-stopped
networks:
sv2-net:
ipv4_address: 10.5.0.21
monitor-traffic-tcpdump:
image: inzania/network-traffic-metrics:latest
network_mode: host
container_name: monitor-traffic-tcpdump
platform: linux/amd64
environment:
- "NTM_INTERFACE=any"
- "NTM_FILTERS="
prometheus:
image: prom/prometheus:v2.36.2
volumes:
- ./prometheus/:/etc/prometheus/
- prometheus_data_config_c:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
- "--web.console.templates=/usr/share/prometheus/consoles"
- "--web.enable-lifecycle"
- "--web.enable-admin-api"
ports:
- "9090:9090"
container_name: prometheus
depends_on:
- cadvisor
networks:
sv2-net:
ipv4_address: 10.5.0.9
deploy:
placement:
constraints:
- node.role==manager
restart_policy:
condition: on-failure
extra_hosts:
- "host.docker.internal:10.5.0.1"
node-exporter:
image: quay.io/prometheus/node-exporter:latest
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- "--path.procfs=/host/proc"
- "--path.sysfs=/host/sys"
- --collector.filesystem.ignored-mount-points
- "^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)"
ports:
- "9100:9100"
container_name: node-exporter
networks:
sv2-net:
ipv4_address: 10.5.0.10
deploy:
mode: global
restart_policy:
condition: on-failure
cadvisor:
image: gcr.io/cadvisor/cadvisor
volumes:
- /:/rootfs:ro
#- /var/run:/var/run:rw
- /var/run/docker.sock:/var/run/docker.sock:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
ports:
- "8080:8080"
container_name: cadvisor
networks:
sv2-net:
ipv4_address: 10.5.0.12
deploy:
mode: global
restart_policy:
condition: on-failure
grafana:
image: grafana/grafana
depends_on:
- prometheus
- loki
ports:
- "3000:3000"
environment:
GF_USERS_ALLOW_SIGN_UP: "false"
GF_AUTH_DISABLE_LOGIN_FORM: "true"
GF_AUTH_DISABLE_SIGNOUT_MENU: "true"
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: "Admin"
GF_RENDERING_SERVER_URL: http://renderer:8081/render
GF_RENDERING_CALLBACK_URL: http://grafana:3000/
GF_LOG_FILTERS: rendering:debug
container_name: grafana
volumes:
- grafana_data_config_c:/var/lib/grafana
- ./grafana/provisioning/dashboards/config-c:/etc/grafana/provisioning/dashboards
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
env_file:
- ./grafana/config.monitoring
networks:
sv2-net:
ipv4_address: 10.5.0.13
user: "472"
deploy:
placement:
constraints:
- node.role==manager
restart_policy:
condition: on-failure
reporter:
image: izakmarais/grafana-reporter:${gr_version:-latest}
command: "-ip grafana:3000 -grid-layout=1"
container_name: reporter
platform: linux/amd64
depends_on:
- grafana
ports:
- "8686:8686"
networks:
sv2-net:
ipv4_address: 10.5.0.14
renderer:
image: grafana/grafana-image-renderer:latest
container_name: renderer
depends_on:
- grafana
ports:
- "8081:8081"
networks:
sv2-net:
ipv4_address: 10.5.0.15
pools-latency-calculator:
image: pools-latency-calculator-builder-image
command: ["./target/release/pools-latency-calculator"]
ports:
- "1234:1234"
container_name: pools-latency-calculator
restart: unless-stopped
networks:
sv2-net:
ipv4_address: 10.5.0.18
loki:
image: grafana/loki:2.9.8
container_name: loki
ports:
- "3100:3100"
restart: unless-stopped
networks:
sv2-net:
ipv4_address: 10.5.0.30
aliases:
- loki
volumes:
- ./loki-config.yaml:/etc/loki/loki-config.yaml
command: -config.file=/etc/loki/loki-config.yaml
promtail:
image: grafana/promtail
container_name: promtail
volumes:
- ./promtail/config/config-c/promtail-local-config.yaml:/etc/promtail/config.yaml
- /var/lib/docker/containers:/var/lib/docker/containers
- /var/run/docker.sock:/var/run/docker.sock
command: -config.file=/etc/promtail/config.yaml
restart: unless-stopped
depends_on:
- loki
networks:
sv2-net:
ipv4_address: 10.5.0.31
aliases:
- promtail
log-server:
image: log-server-builder-image
command: ["./target/release/log-server"]
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "7420:7420"
environment:
- LOG_LABEL=config-c
- RUST_LOG=info
container_name: log-server
depends_on:
- log-server-builder
restart: unless-stopped
networks:
sv2-net:
ipv4_address: 10.5.0.32