diff --git a/docker/layer2/entrypoint.sh b/docker/layer2/entrypoint.sh index 4b640626..925b07f3 100755 --- a/docker/layer2/entrypoint.sh +++ b/docker/layer2/entrypoint.sh @@ -27,6 +27,7 @@ function stop-ckb-miner() { function start-godwoken-at-background() { log "Starting" + start_time=$(date +%s) godwoken run -c $CONFIG_DIR/godwoken-config.toml & # &> /dev/null & GODWOKEN_PID=$! while true; do @@ -35,6 +36,11 @@ function start-godwoken-at-background() { if [ "$result" != "Godwoken not started" ]; then break fi + elapsed=$(( $(date +%s) - start_time )) + if [ $elapsed -gt 10 ]; then + log "ERROR: start godwoken timeout" + exit 2 + fi done log "Godwoken started" }