forked from alchemydc/z3
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdocker-compose.regtest.yml
More file actions
78 lines (74 loc) · 3.33 KB
/
Copy pathdocker-compose.regtest.yml
File metadata and controls
78 lines (74 loc) · 3.33 KB
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
# Regtest overlay merged on top of docker-compose.yml.
#
# Usage:
# docker compose --env-file .env.regtest up -d
# ./scripts/regtest-init.sh (first time, to generate keys + mine block 1)
#
# Only contains regtest-specific structural overrides. Network selection,
# port matrix, project name, and config dir come from .env.regtest.
services:
zebra:
# ZEBRA_MINING__MINER_ADDRESS is required for regtest mining. The :? guard
# fails the compose substitution with a clear message if the var is unset,
# rather than passing an empty string that crashes Zebra at startup
# (config-rs treats empty strings as values; ZcashAddress::from_str("")
# is a parse error).
environment:
ZEBRA_MINING__MINER_ADDRESS: ${ZEBRA_MINING__MINER_ADDRESS:?must be set in .env.regtest or shell environment}
# Zebra's default regtest stops at Canopy; this config activates every
# supported upgrade through NU6.3 at height 2. zebrad reads
# ~/.config/zebrad.toml automatically.
volumes:
- ${Z3_CONFIG_DIR:-./config/regtest}/zebra.toml:/home/zebra/.config/zebrad.toml:ro
# Regtest is peerless, so p2p is not published (its container port also
# reuses testnet's 18233). Re-list the published ports without p2p.
ports: !override
- "${Z3_ZEBRA_HOST_RPC_PORT:-29232}:${Z3_ZEBRA_RPC_PORT:-18232}"
- "${Z3_ZEBRA_HOST_HEALTH_PORT:-28080}:8080"
# Regtest has no peers; check RPC directly instead of /ready.
healthcheck:
test: ["CMD-SHELL", "curl -sf -X POST -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"method\":\"getblockchaininfo\",\"params\":[],\"id\":1}' http://127.0.0.1:${Z3_ZEBRA_RPC_PORT:-18232} || exit 1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
zaino:
# Regtest uses username/password auth (set in config/regtest/zaino.toml),
# not cookie auth. Override the full environment to drop the cookie path
# inherited from the base.
environment: !override
RUST_LOG: ${Z3_ZAINO_RUST_LOG:-${RUST_LOG:-info}}
ZAINO_NETWORK: Regtest
ZAINO_VALIDATOR_SETTINGS__VALIDATOR_JSONRPC_LISTEN_ADDRESS: zebra:${Z3_ZEBRA_RPC_PORT:-18232}
ZAINO_GRPC_SETTINGS__LISTEN_ADDRESS: 0.0.0.0:8137
volumes: !override
- ${Z3_ZAINO_DATA_PATH:-zaino}:/app/data
- ${Z3_CONFIG_DIR:-./config/regtest}/zaino.toml:/etc/zaino/zindexer.toml:ro
zallet:
# Regtest uses username/password auth. Override the volumes list to drop
# the cookie volume mount (the distroless image lacks a shell to create
# /var/run dirs at runtime).
volumes: !override
- ${Z3_ZALLET_DATA_PATH:-zallet}:/var/lib/zallet
- zallet_ca_certificates:/etc/ssl/certs:ro
- ${Z3_CONFIG_DIR:-./config/regtest}/zallet.toml:/etc/zallet/zallet.toml:ro
rpc-router:
build:
context: ./rpc-router
dockerfile: Dockerfile
restart: unless-stopped
cap_drop: [ALL]
security_opt: [no-new-privileges:true]
environment:
ZEBRA_URL: http://zebra:${Z3_ZEBRA_RPC_PORT:-18232}
ZALLET_URL: http://zallet:28232
RPC_USER: ${Z3_REGTEST_RPC_ROUTER_USER:-zebra}
RPC_PASSWORD: ${Z3_REGTEST_RPC_ROUTER_PASSWORD:-zebra}
LISTEN_PORT: "8181"
ports:
- "${Z3_REGTEST_RPC_ROUTER_HOST_PORT:-8181}:8181"
depends_on:
zebra:
condition: service_healthy
zallet:
condition: service_started