diff --git a/beacon-chain/Dockerfile b/beacon-chain/Dockerfile index 800212d..e195207 100644 --- a/beacon-chain/Dockerfile +++ b/beacon-chain/Dockerfile @@ -1,6 +1,9 @@ ARG UPSTREAM_VERSION FROM chainsafe/lodestar:${UPSTREAM_VERSION} +# curl is required to check if mev-boost is running +RUN apk update && apk add --no-cache curl + COPY jwtsecret.hex /jwtsecret COPY entrypoint.sh /usr/local/bin/entrypoint.sh diff --git a/beacon-chain/entrypoint.sh b/beacon-chain/entrypoint.sh index 95f7036..7da5d0c 100755 --- a/beacon-chain/entrypoint.sh +++ b/beacon-chain/entrypoint.sh @@ -22,6 +22,18 @@ case $_DAPPNODE_GLOBAL_EXECUTION_CLIENT_HOLESKY in ;; esac +# MEV-Boost: https://chainsafe.github.io/lodestar/beacon-management/mev-and-builder-integration/ +if [ -n "$_DAPPNODE_GLOBAL_MEVBOOST_HOLESKY" ] && [ "$_DAPPNODE_GLOBAL_MEVBOOST_HOLESKY" == "true" ]; then + echo "MEV-Boost is enabled" + MEVBOOST_URL="http://mev-boost.mev-boost-holesky.dappnode:18550" + if curl --retry 5 --retry-delay 5 --retry-all-errors "${MEVBOOST_URL}"; then + EXTRA_OPTS="--builder --builder.url=${MEVBOOST_URL} ${EXTRA_OPTS}" + else + echo "MEV-Boost is enabled but the Holesky MEV-Boost package at ${MEVBOOST_URL} is not reachable" + curl -X POST -G 'http://my.dappnode/notification-send' --data-urlencode 'type=danger' --data-urlencode title="${MEVBOOST_URL} can not be reached" --data-urlencode 'body=Make sure the Holesky MEV-Boost DNP is available and running' + fi +fi + exec node --max-old-space-size=${MEMORY_LIMIT} /usr/app/node_modules/.bin/lodestar \ beacon \ --network=holesky \ diff --git a/dappnode_package.json b/dappnode_package.json index c3fae9b..512b0b9 100644 --- a/dappnode_package.json +++ b/dappnode_package.json @@ -41,8 +41,12 @@ }, "globalEnvs": [ { - "envs": ["EXECUTION_CLIENT_HOLESKY"], + "envs": ["EXECUTION_CLIENT_HOLESKY", "MEVBOOST_HOLESKY"], "services": ["beacon-chain"] + }, + { + "envs": ["MEVBOOST_HOLESKY"], + "services": ["validator"] } ] } diff --git a/validator/entrypoint.sh b/validator/entrypoint.sh index 9ec6491..adeabc6 100755 --- a/validator/entrypoint.sh +++ b/validator/entrypoint.sh @@ -1,5 +1,11 @@ #!/bin/sh +# MEV-Boost: https://chainsafe.github.io/lodestar/beacon-management/mev-and-builder-integration/ +if [ -n "$_DAPPNODE_GLOBAL_MEVBOOST_HOLESKY" ] && [ "$_DAPPNODE_GLOBAL_MEVBOOST_HOLESKY" == "true" ]; then + echo "MEV-Boost is enabled" + EXTRA_OPTS="--builder ${EXTRA_OPTS}" +fi + # Handle Graffiti Character Limit oLang=$LANG oLcAll=$LC_ALL LANG=C LC_ALL=C