diff --git a/app/data/compose/docker-compose-fixturenet-lotus.yml b/app/data/compose/docker-compose-fixturenet-lotus.yml index d4e72b79..3727c8e2 100644 --- a/app/data/compose/docker-compose-fixturenet-lotus.yml +++ b/app/data/compose/docker-compose-fixturenet-lotus.yml @@ -11,14 +11,6 @@ services: - ../config/fixturenet-lotus/genesis/devgen.car:/devgen.car - $HOME/stack-orchestrator/app/data/config/fixturenet-lotus/genesis/.genesis-sectors:/root/.genesis-sectors - lotus-shared:/root/.lotus-shared - healthcheck: -# test: ["CMD-SHELL", "grep 'started ChainNotify channel' /var/log/lotus.log"] -# test: ["CMD-SHELL", "[ -f /root/.lotus-shared/miner.addr ]"] - test: ["CMD-SHELL", "[ -d /root/.lotus-miner-local-net ]"] - interval: 10s - timeout: 10s - retries: 10 - start_period: 60s entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-miner.sh"] ports: - "1234" @@ -36,8 +28,7 @@ services: - ../config/fixturenet-lotus/genesis/devgen.car:/devgen.car - lotus-shared:/root/.lotus-shared depends_on: - lotus-miner: - condition: service_healthy + - lotus-miner entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-node.sh"] ports: - "1234" @@ -55,8 +46,7 @@ services: - ../config/fixturenet-lotus/genesis/devgen.car:/devgen.car - lotus-shared:/root/.lotus-shared depends_on: - lotus-miner: - condition: service_healthy + - lotus-miner entrypoint: ["sh", "/docker-entrypoint-scripts.d/setup-node.sh"] ports: - "1234" diff --git a/app/data/config/fixturenet-lotus/setup-miner.sh b/app/data/config/fixturenet-lotus/setup-miner.sh index 1b818de6..e0e362f3 100644 --- a/app/data/config/fixturenet-lotus/setup-miner.sh +++ b/app/data/config/fixturenet-lotus/setup-miner.sh @@ -2,8 +2,11 @@ lotus --version -# # remove old bootnode peer info if present -# [ -f /root/.lotus-shared/miner.addr ] && rm /root/.lotus-shared/miner.addr +# remove old bootnode peer info if present +if [ -f /root/.lotus-shared/miner.addr ]; then + rm /root/.lotus-shared/miner.addr +fi + ##TODO: generate genesis files inside container instead of bundling in config dir ##something like commands below should work, other scripts/compose will have to be updated to corresponding directories diff --git a/app/data/config/fixturenet-lotus/setup-node.sh b/app/data/config/fixturenet-lotus/setup-node.sh index 0bcd4717..2abf8f1b 100644 --- a/app/data/config/fixturenet-lotus/setup-node.sh +++ b/app/data/config/fixturenet-lotus/setup-node.sh @@ -4,6 +4,13 @@ lotus --version ##TODO: paths can use values from lotus-env.env file +# Loop until the daemon is started +echo "Waiting for miner to share peering info..." +while [ ! -f /root/.lotus-shared/miner.addr ]; do + sleep 5 +done +echo "Resuming..." + # if not already initialized if [ ! -f /root/.lotus-local-net/config.toml ]; then # init node config