diff --git a/consensus-entrypoint b/consensus-entrypoint index 05b89467a..e9a60bdfe 100755 --- a/consensus-entrypoint +++ b/consensus-entrypoint @@ -41,8 +41,12 @@ if [[ -z "${BASE_NODE_L2_ENGINE_AUTH_RAW:-}" ]]; then exit 1 fi -until [ "$(curl -s --max-time 10 --connect-timeout 5 -w '%{http_code}' -o /dev/null "${BASE_NODE_L2_ENGINE_RPC/ws/http}")" -eq 401 ]; do - echo "waiting for execution client to be ready" + +until curl -s --max-time 10 --connect-timeout 5 \ + -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' \ + http://execution:8545 | grep -q '"result"'; do + echo "waiting for execution client RPC to be ready" sleep 5 done