File tree Expand file tree Collapse file tree 5 files changed +28
-3
lines changed
Expand file tree Collapse file tree 5 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ bootstrap:
1010
1111.PHONY :network
1212network :
13+ docker compose -f docker-compose.simple.yml up -d autoheal
1314 docker compose -f docker-compose.simple.yml up -d bsc-rpc bsc-validator1-1 bsc-validator1-2 bsc-validator1-3 bsc-validator1-4 bsc-validator1-5
1415 docker compose -f docker-compose.simple.yml up -d bsc-rpc2 bsc-validator2-1 bsc-validator2-2 bsc-validator2-3
1516
Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ services:
7171 - ./scripts:/scripts
7272 - ./config:/config
7373 command : ash /scripts/bsc-rpc.sh
74+ healthcheck :
75+ test : ["CMD", "ash", "/scripts/healthcheck.sh"]
76+ interval : " 5s"
77+ start_period : " 10s"
7478
7579 bsc-rpc2 : # This is the bootstrap node
7680 image : bsc-geth:docker-local
@@ -86,6 +90,10 @@ services:
8690 - ./scripts:/scripts
8791 - ./config:/config
8892 command : ash /scripts/bsc-rpc.sh
93+ healthcheck :
94+ test : ["CMD", "ash", "/scripts/healthcheck.sh"]
95+ interval : " 5s"
96+ start_period : " 10s"
8997
9098 bsc-validator1-1 :
9199 image : bsc-geth:docker-local
@@ -217,6 +225,14 @@ services:
217225 - ./scripts:/scripts
218226 command : ash /scripts/bsc-validator.sh
219227
228+ autoheal :
229+ restart : always
230+ image : willfarrell/autoheal
231+ environment :
232+ - AUTOHEAL_CONTAINER_LABEL=all
233+ volumes :
234+ - /var/run/docker.sock:/var/run/docker.sock
235+
220236networks :
221237 bsc :
222238 ipam :
@@ -227,4 +243,4 @@ networks:
227243 ipam :
228244 driver : default
229245 config :
230- - subnet : 99.98.0.0/16
246+ - subnet : 99.98.0.0/16
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ while [ "$i" -lt ${account_cnt} ]; do
1313done
1414
1515ETHSTATS=" "
16- geth --config ${DATA_DIR} /config.toml --datadir ${DATA_DIR} --netrestrict ${CLUSTER_CIDR} \
16+ # Use exec to handle signals
17+ exec geth --config ${DATA_DIR} /config.toml --datadir ${DATA_DIR} --netrestrict ${CLUSTER_CIDR} \
1718 --state.scheme=hash --db.engine=leveldb --verbosity ${VERBOSE} --nousb ${ETHSTATS} \
1819 --unlock ${unlock_sequences} --password /dev/null --ipcpath /gethipc --override.fixedturnlength 2
Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ HOST_IP=$(hostname -i)
1010echo " validator id: ${HOST_IP} "
1111
1212ETHSTATS=" "
13- geth --config ${DATA_DIR} /config.toml --datadir ${DATA_DIR} --netrestrict ${CLUSTER_CIDR} \
13+ # Use exec to handle signals
14+ exec geth --config ${DATA_DIR} /config.toml --datadir ${DATA_DIR} --netrestrict ${CLUSTER_CIDR} \
1415 --verbosity ${VERBOSE} --nousb ${ETHSTATS} --state.scheme=hash --db.engine=leveldb \
1516 --bootnodes enode://${BOOTSTRAP_PUB_KEY} @${BOOTSTRAP_IP} :${BOOTSTRAP_TCP_PORT} \
1617 --mine --miner.etherbase=${VALIDATOR_ADDR} -unlock ${VALIDATOR_ADDR} --password /dev/null --blspassword /scripts/wallet_password.txt \
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e
4+
5+ timestamp=$( geth attach --exec ' parseInt(eth.getBlockByNumber("latest").timestamp)' /gethipc)
6+ [ $(( $(date '+% s') - $timestamp )) -lt 5 ]
You can’t perform that action at this time.
0 commit comments