-
Notifications
You must be signed in to change notification settings - Fork 89
/
matic-sentry-with-snapshotting.yml
82 lines (78 loc) · 2.91 KB
/
matic-sentry-with-snapshotting.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
version: "3.3"
networks:
devnet-network:
driver: bridge
ipam:
config:
- subnet: 172.20.1.0/24
services:
heimdall0:
image: "maticnetwork/heimdall:${HEIMDALL_TAG}"
command: >
bash -c "
if [ ! -f \"/root/.heimdalld/config/config.toml\" ]
then
heimdalld init --home /root/.heimdalld --chain-id ${HEIMDALL_CHAIN_ID} \
&& if [ ${BOR_MODE} == \"archive\" ]
then
tar -xzvf /root/snapshot/${HEIMDALL_ARCHIVE_NODE_SNAPSHOT_FILE} -C /root/.heimdalld/data/
else
tar -xzvf /root/snapshot/${HEIMDALL_FULL_NODE_SNAPSHOT_FILE} -C /root/.heimdalld/data/
fi
fi \
&& wget -O /root/.heimdalld/config/genesis.json ${HEIMDALL_GENESIS_URL} -P /root/.heimdalld/config \
&& sed -i '/seeds =/c\seeds = \"${HEIMDALL_SEEDS}\"' /root/.heimdalld/config/config.toml \
&& sed -i '/26657/c\laddr = \"tcp://0.0.0.0:26657\"' /root/.heimdalld/config/config.toml \
&& sed -i '/bor_rpc_url/c\bor_rpc_url = \"${HEIMDALL_BOR_RPC_URL}\"' /root/.heimdalld/config/heimdall-config.toml \
&& sed -i '/eth_rpc_url/c\eth_rpc_url = \"${HEIMDALL_ETH_RPC_URL}\"' /root/.heimdalld/config/heimdall-config.toml \
&& cd /root/scripts && ./heimdall-startup.sh && sleep infinity
"
container_name: heimdall0
networks:
- devnet-network
volumes:
- ./heimdall/scripts:/root/scripts
- ./heimdall/snapshot/:/root/snapshot
- ./heimdall/logs/:/root/logs/
- ./heimdall/heimdalld/:/root/.heimdalld
ports:
- "1317:1317"
- "26657:26657"
- "26656:26656"
bor0:
image: "maticnetwork/bor:${BOR_TAG}"
container_name: bor0
command: >
sh -c "
cd /root \
&& wget -O setup.sh ${BOR_SETUP} \
&& wget -O genesis.json ${BOR_GENESIS} \
&& wget -O static-nodes.json ${BOR_STATIC_FILE} \
&& sh setup.sh \
&& if [ ! -f \"start.sh\" ]
then
if [ ${BOR_MODE} == \"archive\" ]
then
tar -xzvf /root/snapshot/${BOR_ARCHIVE_NODE_SNAPSHOT_FILE} -C /root/.bor/data/bor/chaindata
else
tar -xzvf /root/snapshot/${BOR_FULL_NODE_SNAPSHOT_FILE} -C /root/.bor/data/bor/chaindata
fi
fi \
&& wget -O start.sh ${BOR_START} \
&& sed -i '/datadir/ a --bootnodes \"${BOR_BOOTNODES}\" \\\' start.sh \
&& sed -i '/datadir/ a --bor.heimdall http://heimdall0:1317 \\\' start.sh \
&& if [ ${BOR_MODE} == \"archive\" ]
then
sed -i '/datadir/ a --gcmode \"archive\" \\\' start.sh && sed -i '/datadir/ a --ws --ws.port 8546 --ws.addr 0.0.0.0 --ws.origins \"*\" \\\' start.sh
fi \
&& sh start.sh
"
networks:
devnet-network:
ipv4_address: 172.20.1.100
volumes:
- ./bor/snapshot/:/root/snapshot
- ./bor/data:/root/.bor
ports:
- "8545:8545"
- "8546:8546"