Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding support for arbitrary additional flags to be passed to the MevBoost script via MevBoostConfig.
  • Loading branch information
SolezOfScience committed Aug 1, 2024
1 parent 20b9be6 commit 688751d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
25 changes: 23 additions & 2 deletions install/scripts/start-mev-boost.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
#!/bin/sh

parse_additional_flags() {
# Check if the environment variable MEV_BOOST_ADDITIONAL_FLAGS is not empty
if [ -n "$MEV_BOOST_ADDITIONAL_FLAGS" ]; then
# Split the input string into an array of key-value pairs using comma as the delimiter
IFS=',' read -r -a pairs <<< "$MEV_BOOST_ADDITIONAL_FLAGS"

# Iterate over each key-value pair
for pair in "${pairs[@]}"; do
# Extract the key and value from the current pair
key=$(echo "$pair" | cut -d'=' -f1)
value=$(echo "$pair" | cut -d'=' -f2)

# Check if the key is "min-bid" and set the MIN_BID variable
if [ "$key" = "min-bid" ]; then
MIN_BID="$value"
fi
done
fi
}

# Set up the network-based flag
if [ "$NETWORK" = "mainnet" ]; then
MEV_NETWORK="mainnet"
Expand All @@ -10,5 +30,6 @@ else
exit 1
fi

# Run MEV-boost
exec /app/mev-boost -${MEV_NETWORK} -addr 0.0.0.0:${MEV_BOOST_PORT} -relay-check -relays ${MEV_BOOST_RELAYS}
parse_additional_flags

exec /app/mev-boost -${MEV_NETWORK} -addr 0.0.0.0:${MEV_BOOST_PORT} -relay-check -relays ${MEV_BOOST_RELAYS} ${ADDITIONAL_ARGS}
1 change: 1 addition & 0 deletions install/templates/mev-boost.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ services:
- NETWORK={{.Smartnode.Network}}
- MEV_BOOST_PORT={{.MevBoost.Port}}
- MEV_BOOST_RELAYS={{.MevBoost.GetRelayString}}
- MEV_BOOST_ADDITIONAL_FLAGS={{.MevBoost.AdditionalFlags}}
entrypoint: sh
command: "/setup/start-mev-boost.sh"
cap_drop:
Expand Down

0 comments on commit 688751d

Please sign in to comment.