-
Notifications
You must be signed in to change notification settings - Fork 11
/
docker-compose.yml
588 lines (556 loc) · 18.6 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
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
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
# Variables.
# ------------------------------------------------------------------------------
x-common-vars:
- &STACKS_BLOCKCHAIN_COMMIT b26f406fc0bfd271a5cd5b54ccb064e7d3a0650a
- &STACKS_API_COMMIT 46e1ae256e474eac98979d0a3df685fe3fa48d6d
- &BTC_ADDR miEJtNKa3ASpA19v5ZhvbKTEieYjLpzCYT
- &MINER_SEED 9e446f6b0c6a96cf2190e54bcd5a8569c3e386f091605499464389b8d4e0bfc201 # stx: STEW4ZNT093ZHK4NEQKX8QJGM2Y7WWJ2FQQS5C19, btc: miEJtNKa3ASpA19v5ZhvbKTEieYjLpzCYT, pub_key: 035379aa40c02890d253cfa577964116eb5295570ae9f7287cbae5f2585f5b2c7c, wif: cStMQXkK5yTFGP3KbNXYQ3sJf2qwQiKrZwR9QJnksp32eKzef1za
- &BITCOIN_PEER_PORT 18444
- &BITCOIN_RPC_PORT 18443
- &BITCOIN_BLOCK_HASH_STREAM_PORT 28332
- &BITCOIN_RPC_USER devnet
- &BITCOIN_RPC_PASS devnet
- &MINE_INTERVAL ${MINE_INTERVAL:-1s}
- &MINE_INTERVAL_EPOCH25 ${MINE_INTERVAL_EPOCH25:-5s} # 5 second bitcoin block times in epoch 2.5
- &MINE_INTERVAL_EPOCH3 ${MINE_INTERVAL_EPOCH3:-15s} # 15 second bitcoin block times in epoch 3
- &NAKAMOTO_BLOCK_INTERVAL 2 # seconds to wait between issuing stx-transfer transactions (which triggers Nakamoto block production)
- &STACKS_20_HEIGHT ${STACKS_20_HEIGHT:-0}
- &STACKS_2_05_HEIGHT ${STACKS_2_05_HEIGHT:-203}
- &STACKS_21_HEIGHT ${STACKS_21_HEIGHT:-204}
- &STACKS_POX2_HEIGHT ${STACKS_POX2_HEIGHT:-205} # 104 is is stacks_block=1, 106 is stacks_block=3
- &STACKS_22_HEIGHT ${STACKS_22_HEIGHT:-206}
- &STACKS_23_HEIGHT ${STACKS_23_HEIGHT:-207}
- &STACKS_24_HEIGHT ${STACKS_24_HEIGHT:-208}
- &STACKS_25_HEIGHT ${STACKS_25_HEIGHT:-209}
- &STACKS_30_HEIGHT ${STACKS_30_HEIGHT:-232}
- &STACKING_CYCLES ${STACKING_CYCLES:-1} # number of cycles to stack-stx or stack-extend for
- &POX_PREPARE_LENGTH ${POX_PREPARE_LENGTH:-5}
- &POX_REWARD_LENGTH ${POX_REWARD_LENGTH:-20}
- &REWARD_RECIPIENT ${REWARD_RECIPIENT:-STQM73RQC4EX0A07KWG1J5ECZJYBZS4SJ4ERC6WN} # priv: 6ad9cadb42d4edbfbe0c5bfb3b8a4125ddced021c4174f829b714ccbf527f02001
- &EXIT_FROM_MONITOR 1 # set to "1" to automatically shut down via monitor.ts
# Templates.
# ------------------------------------------------------------------------------
x-postgres: &postgres
image: postgres:15-alpine
stop_grace_period: 5s
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: signer
profiles:
- sbtc-signer
- sbtc-postgres
x-sbtc-signer: &sbtc-signer
build:
context: ../
dockerfile: docker/sbtc/Dockerfile
target: signer
entrypoint: "/bin/bash -c '/usr/local/bin/signer -c /signer-config.toml --migrate-db'"
environment: &sbtc-signer-environment
RUST_LOG: info
SIGNER_SIGNER__P2P__LISTEN_ON: tcp://0.0.0.0:4122
volumes:
- ./sbtc/signer/signer-config.toml:/signer-config.toml
profiles:
- sbtc-signer
x-stacks-signer: &stacks-signer
build:
context: stacks
args:
GIT_COMMIT: *STACKS_BLOCKCHAIN_COMMIT
depends_on:
- stacks-node
volumes:
- ./stacks/stacks-signer.toml:/data/config.toml.in
environment: &stacks-signer-environment
STACKS_NODE_HOST: stacks-node:20443
STACKS_SIGNER_ENDPOINT: 0.0.0.0:30000
entrypoint:
- /bin/bash
- -c
- |
set -e
envsubst < config.toml.in > config.toml
exec stacks-signer run --config config.toml
profiles:
- default
# Services.
# ------------------------------------------------------------------------------
services:
# Emily API.
# ----------
# DynamoDB Tables for the Emily API.
emily-dynamodb:
image: "amazon/dynamodb-local:latest"
command: "-jar DynamoDBLocal.jar -sharedDb -dbPath ."
ports:
- "8000:8000"
profiles:
- default
# Modifies Emily's CDK template and creates DynamoDB Tables.
emily-aws-setup:
build:
context: ../
dockerfile: docker/sbtc/Dockerfile
target: emily-aws-setup
depends_on:
- emily-dynamodb
environment:
- DYNAMODB_ENDPOINT=http://emily-dynamodb:8000
# Runs the Emily server.
emily-server:
build:
context: ../
dockerfile: docker/sbtc/Dockerfile
target: emily-server
depends_on:
emily-aws-setup:
condition: service_completed_successfully
environment:
- DYNAMODB_ENDPOINT=http://emily-dynamodb:8000
- AWS_ACCESS_KEY_ID=xxxxxxxxxxxx
- AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxx
- AWS_REGION=us-west-2
- PORT=3031
- DEFAULT_PEG_CAP=100000000000
- DEFAULT_PER_DEPOSIT_CAP=100000000
- DEFAULT_PER_WITHDRAWAL_CAP=100000000
ports:
- "3031:3031"
# sBTC Signers.
# ------------------
# sbtc signer 1 ----
postgres-1:
<<: *postgres # Inherit all from the "postgres" service
container_name: postgres-1
ports:
- 5432:5432
sbtc-signer-1:
<<: *sbtc-signer # Inherit all from the "sbtc-signer" service
container_name: sbtc-signer-1
depends_on:
- postgres-1
environment:
<<: *sbtc-signer-environment
SIGNER_SIGNER__DB_ENDPOINT: postgresql://postgres:postgres@postgres-1:5432/signer
SIGNER_SIGNER__PRIVATE_KEY: 41634762d89dfa09133a4a8e9c1378d0161d29cd0a9433b51f1e3d32947a73dc
SIGNER_SIGNER__P2P__SEEDS: tcp://sbtc-signer-2:4122,tcp://sbtc-signer-3:4122
ports:
- "8801:8801"
# sbtc signer 2 ----
postgres-2:
<<: *postgres # Inherit all from the "postgres" service
container_name: postgres-2
ports:
- 5433:5432
sbtc-signer-2:
<<: *sbtc-signer # Inherit all from the "sbtc-signer" service
container_name: sbtc-signer-2
depends_on:
- postgres-2
environment:
<<: *sbtc-signer-environment
SIGNER_SIGNER__DB_ENDPOINT: postgresql://postgres:postgres@postgres-2:5432/signer
SIGNER_SIGNER__PRIVATE_KEY: 9bfecf16c9c12792589dd2b843f850d5b89b81a04f8ab91c083bdf6709fbefee01
SIGNER_SIGNER__P2P__SEEDS: tcp://sbtc-signer-1:4122,tcp://sbtc-signer-3:4122
ports:
- "8802:8801"
# sbtc signer 3 ----
postgres-3:
<<: *postgres # Inherit all from the "postgres" service
container_name: postgres-3
ports:
- 5434:5432
sbtc-signer-3:
<<: *sbtc-signer # Inherit all from the "sbtc-signer" service
container_name: sbtc-signer-3
depends_on:
- postgres-3
environment:
<<: *sbtc-signer-environment
SIGNER_SIGNER__DB_ENDPOINT: postgresql://postgres:postgres@postgres-3:5432/signer
SIGNER_SIGNER__PRIVATE_KEY: 3ec0ca5770a356d6cd1a9bfcbf6cd151eb1bd85c388cc00648ec4ef5853fdb7401
SIGNER_SIGNER__P2P__SEEDS: tcp://sbtc-signer-1:4122,tcp://sbtc-signer-2:4122
ports:
- "8803:8801"
# Blocklist client.
# -----------------
blocklist-client:
build:
context: ../
dockerfile: docker/sbtc/Dockerfile
target: blocklist-client
environment:
BLOCKLIST_CLIENT_RISK_ANALYSIS__API_URL: ${BLOCKLIST_CLIENT_RISK_ANALYSIS__API_URL:-https://public.chainalysis.com}
BLOCKLIST_CLIENT_RISK_ANALYSIS__API_KEY: ${BLOCKLIST_CLIENT_RISK_ANALYSIS__API_KEY:-}
BLOCKLIST_CLIENT_SERVER__HOST: "0.0.0.0"
ports:
- "3030:3030"
profiles:
- default
# sBTC Bridge Website.
# --------------------
sbtc-bridge-website:
build:
context: bridge-website
dockerfile: Dockerfile
depends_on:
- stacks-node
- stacks-api
- emily-server
- bitcoin
ports:
- "3010:3000"
profiles:
- default
# Bitcoin / Burnchain.
# --------------------
bitcoin:
build: bitcoin
ports:
- "18443:18443"
- "28332:28332"
volumes:
- ./bitcoin/bitcoin.conf:/root/.bitcoin/bitcoin.conf
entrypoint:
- /bin/bash
- -c
- |
set -e
bitcoind
profiles:
- default
- bitcoin-mempool
bitcoin-miner:
build: bitcoin
depends_on:
- bitcoin
volumes:
- ./bitcoin/bitcoin.conf:/root/.bitcoin/bitcoin.conf
environment:
BTC_ADDR: *BTC_ADDR
MINE_INTERVAL: *MINE_INTERVAL
MINE_INTERVAL_EPOCH3: *MINE_INTERVAL_EPOCH3
MINE_INTERVAL_EPOCH25: *MINE_INTERVAL_EPOCH25
INIT_BLOCKS: 101
STACKS_30_HEIGHT: *STACKS_30_HEIGHT
STACKS_25_HEIGHT: *STACKS_25_HEIGHT
entrypoint:
- /bin/bash
- -c
- |
set -e
trap "exit" INT TERM
trap "kill 0" EXIT
bitcoin-cli -rpcconnect=bitcoin -rpcwait getmininginfo
bitcoin-cli -rpcconnect=bitcoin -named createwallet wallet_name=main descriptors=false
bitcoin-cli -rpcconnect=bitcoin -named createwallet wallet_name=depositor descriptors=true
bitcoin-cli -rpcwallet=main -rpcconnect=bitcoin importaddress $${BTC_ADDR} "" false
bitcoin-cli -rpcwallet=main -rpcconnect=bitcoin generatetoaddress $${INIT_BLOCKS} $${BTC_ADDR}
ADDR=$$(bitcoin-cli -rpcwallet=depositor -rpcconnect=bitcoin getnewaddress label="" bech32)
bitcoin-cli -rpcwallet=depositor -rpcconnect=bitcoin generatetoaddress 101 $${ADDR}
DEFAULT_TIMEOUT=$$(($$(date +%s) + 30))
while true; do
TX=$$(bitcoin-cli -rpcwallet=main -rpcconnect=bitcoin listtransactions '*' 1 0 true)
CONFS=$$(echo "$${TX}" | jq '.[].confirmations')
if [ "$${CONFS}" = "0" ] || [ $$(date +%s) -gt $$DEFAULT_TIMEOUT ]; then
if [ $$(date +%s) -gt $$DEFAULT_TIMEOUT ]; then
echo "Timed out waiting for a mempool tx, mining a btc block..."
else
echo "Detected Stacks mining mempool tx, mining btc block..."
fi
bitcoin-cli -rpcwallet=main -rpcconnect=bitcoin generatetoaddress 1 "$${BTC_ADDR}"
DEFAULT_TIMEOUT=$$(($$(date +%s) + 30))
else
echo "No Stacks mining tx detected"
fi
SLEEP_DURATION=$${MINE_INTERVAL}
BLOCK_HEIGHT=$$(bitcoin-cli -rpcwallet=main -rpcconnect=bitcoin getblockcount)
if [ "$${BLOCK_HEIGHT}" -gt $$(( $${STACKS_30_HEIGHT} + 1 )) ]; then
echo "In Epoch3, sleeping for $${MINE_INTERVAL_EPOCH3} ..."
SLEEP_DURATION=$${MINE_INTERVAL_EPOCH3}
elif [ "$${BLOCK_HEIGHT}" -gt $$(( $${STACKS_25_HEIGHT} + 1 )) ]; then
echo "In Epoch2.5, sleeping for $${MINE_INTERVAL_EPOCH25} ..."
SLEEP_DURATION=$${MINE_INTERVAL_EPOCH25}
fi
sleep $${SLEEP_DURATION} &
wait || exit 0
done
profiles:
- default
- bitcoin-mempool
# Stacks Blockchain.
# ------------------
stacks-node:
build:
context: stacks
args:
GIT_COMMIT: *STACKS_BLOCKCHAIN_COMMIT
depends_on:
- bitcoin
ports:
- "20443:20443"
volumes:
- ./stacks/stacks-regtest-miner.toml:/data/config.toml.in
- ./bitcoin/bitcoin.conf:/root/.bitcoin/bitcoin.conf
environment:
# STACKS_LOG_TRACE: 1 # uncomment for trace logging
# STACKS_LOG_DEBUG: 1
# RUST_LOG: debug
BITCOIN_PEER_HOST: bitcoin
BITCOIN_PEER_PORT: *BITCOIN_PEER_PORT
BITCOIN_RPC_PORT: *BITCOIN_RPC_PORT
BITCOIN_RPC_USER: *BITCOIN_RPC_USER
BITCOIN_RPC_PASS: *BITCOIN_RPC_PASS
MINER_SEED: *MINER_SEED
STACKS_20_HEIGHT: *STACKS_20_HEIGHT
STACKS_2_05_HEIGHT: *STACKS_2_05_HEIGHT
STACKS_21_HEIGHT: *STACKS_21_HEIGHT
STACKS_POX2_HEIGHT: *STACKS_POX2_HEIGHT
STACKS_22_HEIGHT: *STACKS_22_HEIGHT
STACKS_23_HEIGHT: *STACKS_23_HEIGHT
STACKS_24_HEIGHT: *STACKS_24_HEIGHT
STACKS_25_HEIGHT: *STACKS_25_HEIGHT
STACKS_30_HEIGHT: *STACKS_30_HEIGHT
POX_PREPARE_LENGTH: *POX_PREPARE_LENGTH
POX_REWARD_LENGTH: *POX_REWARD_LENGTH
REWARD_RECIPIENT: *REWARD_RECIPIENT
entrypoint:
- /bin/bash
- -c
- |
set -e
envsubst < config.toml.in > config.toml
bitcoin-cli -rpcwait -rpcconnect=bitcoin getmininginfo
exec stacks-node start --config config.toml
profiles:
- default
extra_hosts:
- "host.docker.internal:host-gateway"
stacker:
build: stacker
environment:
STACKS_CORE_RPC_HOST: stacks-node
STACKS_CORE_RPC_PORT: 20443
STACKING_CYCLES: *STACKING_CYCLES
STACKING_KEYS: 41634762d89dfa09133a4a8e9c1378d0161d29cd0a9433b51f1e3d32947a73dc01,9bfecf16c9c12792589dd2b843f850d5b89b81a04f8ab91c083bdf6709fbefee01,3ec0ca5770a356d6cd1a9bfcbf6cd151eb1bd85c388cc00648ec4ef5853fdb7401
STACKS_25_HEIGHT: *STACKS_25_HEIGHT
STACKS_30_HEIGHT: *STACKS_30_HEIGHT
POX_PREPARE_LENGTH: *POX_PREPARE_LENGTH
POX_REWARD_LENGTH: *POX_REWARD_LENGTH
STACKING_INTERVAL: 2 # interval (seconds) for checking if stacking transactions are needed
POST_TX_WAIT: 10 # seconds to wait after a stacking transaction broadcast before continuing the loop
SERVICE_NAME: stacker
depends_on:
- stacks-node
profiles:
- default
tx-broadcaster:
build: stacker
environment:
STACKS_CORE_RPC_HOST: stacks-node
STACKS_CORE_RPC_PORT: 20443
NAKAMOTO_BLOCK_INTERVAL: *NAKAMOTO_BLOCK_INTERVAL
STACKS_30_HEIGHT: *STACKS_30_HEIGHT
ACCOUNT_KEYS: e26e611fc92fe535c5e2e58a6a446375bb5e3b471440af21bbe327384befb50a01,e3ebd73a51da9a2ab0c6679145420876bf4338554a8972e3ab200cef7adbec6001,0bfff38daea4561a4343c9b3f29bfb06e32a988868fc68beed31a6c0f6de4cf701
STACKS_25_HEIGHT: *STACKS_25_HEIGHT
POX_PREPARE_LENGTH: *POX_PREPARE_LENGTH
POX_REWARD_LENGTH: *POX_REWARD_LENGTH
STACKING_KEYS: 41634762d89dfa09133a4a8e9c1378d0161d29cd0a9433b51f1e3d32947a73dc01,9bfecf16c9c12792589dd2b843f850d5b89b81a04f8ab91c083bdf6709fbefee01,3ec0ca5770a356d6cd1a9bfcbf6cd151eb1bd85c388cc00648ec4ef5853fdb7401
depends_on:
- stacks-node
entrypoint:
- /bin/bash
- -c
- |
set -e
exec npx tsx /root/tx-broadcaster.ts
profiles:
- default
stacks-signer-1:
<<: *stacks-signer
container_name: stacks-signer-1
environment:
<<: *stacks-signer-environment
SIGNER_PRIVATE_KEY: 41634762d89dfa09133a4a8e9c1378d0161d29cd0a9433b51f1e3d32947a73dc01
stacks-signer-2:
<<: *stacks-signer
container_name: stacks-signer-2
environment:
<<: *stacks-signer-environment
SIGNER_PRIVATE_KEY: 9bfecf16c9c12792589dd2b843f850d5b89b81a04f8ab91c083bdf6709fbefee01
stacks-signer-3:
<<: *stacks-signer
container_name: stacks-signer-3
environment:
<<: *stacks-signer-environment
SIGNER_PRIVATE_KEY: 3ec0ca5770a356d6cd1a9bfcbf6cd151eb1bd85c388cc00648ec4ef5853fdb7401
monitor:
build: stacker
environment:
STACKS_CORE_RPC_HOST: stacks-api
STACKS_CORE_RPC_PORT: 3999
STACKING_CYCLES: *STACKING_CYCLES
STACKING_KEYS: 41634762d89dfa09133a4a8e9c1378d0161d29cd0a9433b51f1e3d32947a73dc01,9bfecf16c9c12792589dd2b843f850d5b89b81a04f8ab91c083bdf6709fbefee01,3ec0ca5770a356d6cd1a9bfcbf6cd151eb1bd85c388cc00648ec4ef5853fdb7401
STACKS_25_HEIGHT: *STACKS_25_HEIGHT
STACKS_30_HEIGHT: *STACKS_30_HEIGHT
POX_PREPARE_LENGTH: *POX_PREPARE_LENGTH
POX_REWARD_LENGTH: *POX_REWARD_LENGTH
EXIT_FROM_MONITOR: *EXIT_FROM_MONITOR
SERVICE_NAME: monitor
depends_on:
- stacks-node
entrypoint:
- /bin/bash
- -c
- |
set -e
exec npx tsx /root/monitor.ts
profiles:
- default
# Stacks / Hiro API.
# ------------------
postgres-stacks-api:
image: postgres:15-alpine
container_name: postgres-stacks-api
stop_grace_period: 5s
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
profiles:
- default
stacks-api:
image: stacks-api:latest
container_name: stacks-api
stop_grace_period: 5s
build:
context: stacks-api
args:
GIT_URI: "https://github.com/hirosystems/stacks-blockchain-api.git"
GIT_BRANCH: "v8.0.3"
ports:
- 3999:3999
- 3700:3700
depends_on:
- postgres-stacks-api
- stacks-node
- bitcoin
environment:
NODE_ENV: "production"
GIT_TAG: "v7.10.0-nakamoto.7"
PG_HOST: "postgres-stacks-api"
PG_PORT: 5432
PG_USER: "postgres"
PG_PASSWORD: "postgres"
PG_DATABASE: "postgres"
STACKS_CHAIN_ID: "0x80000000"
STACKS_CORE_EVENT_PORT: 3700
STACKS_CORE_EVENT_HOST: "0.0.0.0"
STACKS_BLOCKCHAIN_API_PORT: 3999
STACKS_BLOCKCHAIN_API_HOST: "0.0.0.0"
STACKS_CORE_RPC_HOST: "stacks-node"
STACKS_CORE_RPC_PORT: 20443
API_DOCS_URL: http://localhost:3999/doc
profiles:
- default
stacks-explorer:
image: stacks-explorer
container_name: stacks-explorer
stop_grace_period: 5s
build:
context: stacks-explorer
args:
GIT_URI: "https://github.com/hirosystems/explorer.git"
GIT_BRANCH: "v1.211.2"
ports:
- 3020:3000
depends_on:
- bitcoin
- stacks-node
- stacks-api
- postgres-stacks-api
environment:
NEXT_PUBLIC_MAINNET_API_SERVER: "http://stacks-api:3999"
profiles:
- default
# Mempool.
# --------
electrs:
image: electrs:latest
container_name: electrs
stop_grace_period: 5s
build: electrs
ports:
- 60401:60401
- 3002:3002
depends_on:
- bitcoin
- bitcoin-miner
environment:
RUST_BACKTRACE: 1
BITCOIN_RPC_HOST: "bitcoin"
BITCOIN_RPC_PORT: "18443"
profiles:
- bitcoin-mempool
mariadb:
image: mariadb:10.5.21
container_name: mariadb
stop_grace_period: 5s
ports:
- 3306:3306
environment:
MYSQL_DATABASE: "mempool"
MYSQL_USER: "mempool"
MYSQL_PASSWORD: "mempool"
MYSQL_ROOT_PASSWORD: "admin"
profiles:
- bitcoin-mempool
mempool-web:
image: mempool/frontend:latest
container_name: mempool-web
stop_grace_period: 5s
depends_on:
- mempool-api
- mariadb
- electrs
user: "1000:1000"
restart: on-failure
ports:
- 8083:8083
environment:
FRONTEND_HTTP_PORT: "8083"
BACKEND_MAINNET_HTTP_HOST: "mempool-api"
command: "./wait-for mariadb:3306 --timeout=720 -- nginx -g 'daemon off;'"
profiles:
- bitcoin-mempool
mempool-api:
image: mempool/backend:latest
container_name: mempool-api
stop_grace_period: 5s
depends_on:
- electrs
- mariadb
user: "1000:1000"
restart: on-failure
ports:
- 8999:8999
environment:
# Connect to electrs host
MEMPOOL_BACKEND: "electrum"
ELECTRUM_HOST: "electrs"
ELECTRUM_PORT: "60401"
ELECTRUM_TLS_ENABLED: "false"
# Connect to bitcoin rpc
CORE_RPC_HOST: "bitcoin"
CORE_RPC_PORT: "18443"
CORE_RPC_USERNAME: "devnet"
CORE_RPC_PASSWORD: "devnet"
DATABASE_ENABLED: "true"
DATABASE_HOST: "mariadb"
DATABASE_DATABASE: "mempool"
DATABASE_USERNAME: "mempool"
DATABASE_PASSWORD: "mempool"
STATISTICS_ENABLED: "true"
command: "./wait-for-it.sh mariadb:3306 --timeout=720 --strict -- ./start.sh"
profiles:
- bitcoin-mempool