-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
80 lines (76 loc) · 2.58 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
version: "3.8"
services:
master-node:
image: "babylonlabs-io/babylond"
container_name: master-node
user: root # run as root as we need to install some packages in init scripts
# we need to sleep because docker needs time to bind a big volume
command: >
bash -c "
sleep 5 &&
bash /scripts/init_master.sh &&
babylond --home /root/.babylond start --x-crisis-skip-assert-invariants --log_format 'plain' 2>&1 | tee /root/.babylond/babylond.log
"
cap_add:
- SYS_PTRACE
security_opt:
- seccomp:unconfined
environment:
- SNAPSHOT_FILE=babylon.tar.gz
- RPC_URL=https://rpc.devnet.babylonlabs.io
- GENESIS_PATH=
volumes:
- ./scripts/init_master.sh:/scripts/init_master.sh
- ./snapshots:/snapshots
- ./babylond_data_master:/root/.babylond
ports:
- "26656:26656" # Tendermint RPC
- "26657:26657" # Tendermint P2P
- "26660:26660" # Prometheus metrics
- "1317:1317" # REST API
- "9090:9090" # gRPC
- "2345:2345" # Debugging
networks:
- babylon-net
follower-node:
image: "babylonlabs-io/babylond"
container_name: follower-node
user: root # run as root as we need to install some packages in init scripts
command: >
bash -c "
echo 'Waiting for master node to be ready...' &&
while ! curl -s http://master-node:26657/status > /dev/null; do
echo 'Master node not ready yet. Waiting...'
sleep 5
done &&
echo 'Master node is ready. Proceeding with follower initialization...' &&
bash /scripts/init_follower.sh &&
babylond --home /root/.babylond start --x-crisis-skip-assert-invariants --log_format 'plain' 2>&1 | tee /root/.babylond/babylond.log
"
environment:
- RPC_URL=https://rpc.devnet.babylonlabs.io
- GENESIS_PATH=
volumes:
- ./scripts/init_follower.sh:/scripts/init_follower.sh
- ./babylond_data_follower:/root/.babylond
- ./snapshots:/snapshots # convenient to put genesis.json here
ports:
- "26658:26656" # Tendermint RPC for follower
- "26667:26657" # Tendermint P2P for follower
- "26661:26660" # Prometheus metrics
- "1318:1317" # REST API for follower
- "9091:9090" # gRPC for follower
- "2346:2345" # Debugging for follower
- "6061:6060" # pprof for follower
networks:
- babylon-net
depends_on:
- master-node
networks:
babylon-net:
driver: bridge
ipam:
config:
- subnet: 192.168.100.0/24
volumes:
babylondhome: