diff --git a/install/scripts/start-mev-boost.sh b/install/scripts/start-mev-boost.sh index 41ed264..e8c46d9 100755 --- a/install/scripts/start-mev-boost.sh +++ b/install/scripts/start-mev-boost.sh @@ -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" @@ -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} \ No newline at end of file +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} \ No newline at end of file diff --git a/install/templates/mev-boost.tmpl b/install/templates/mev-boost.tmpl index 115c485..5e8345b 100644 --- a/install/templates/mev-boost.tmpl +++ b/install/templates/mev-boost.tmpl @@ -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: