Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mev boost #32

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions beacon-chain/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
12 changes: 12 additions & 0 deletions beacon-chain/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 5 additions & 1 deletion dappnode_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@
},
"globalEnvs": [
{
"envs": ["EXECUTION_CLIENT_HOLESKY"],
"envs": ["EXECUTION_CLIENT_HOLESKY", "MEVBOOST_HOLESKY"],
"services": ["beacon-chain"]
},
{
"envs": ["MEVBOOST_HOLESKY"],
"services": ["validator"]
}
]
}
6 changes: 6 additions & 0 deletions validator/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading