💾Installation

MEV Boost client installation guide.

Create Aliases

echo "alias mev-log='journalctl -f -u mevboost.service -o cat | ccze -A'" >> ~/.bashrc
echo "alias mev-start='sudo systemctl start mevboost.service'" >> ~/.bashrc
echo "alias mev-stop='sudo systemctl stop mevboost.service'" >> ~/.bashrc
echo "alias mev-restart='sudo systemctl restart mevboost.service'" >> ~/.bashrc
echo "alias mev-status='sudo systemctl status mevboost.service'" >> ~/.bashrc
echo "alias mev-config='sudo vim /etc/systemd/system/mevboost.service'" >> ~/.bashrc
echo "alias mev-enable='sudo systemctl enable mevboost.service'" >> ~/.bashrc
echo "alias mev-disable='sudo systemctl disable mevboost.service'" >> ~/.bashrc
echo "alias mev-update='~/mev-update.sh'" >> ~/.bashrc

source ~/.bashrc

MEV Boost - Install

Build the latest version of MEV Boost.

MEV_VERSION_COMMIT_HASH=        # e.g.441fc16

cd ~
git clone https://github.com/flashbots/mev-boost.git
cd ~/mev-boost
git checkout ${MEV_VERSION_COMMIT_HASH}
make build

Move the compiled MEV Boost build to a new directory.

sudo cp ~/mev-boost/mev-boost /usr/local/bin

Create MEV Boost user and directory.

sudo useradd --no-create-home --shell /bin/false mevboost
sudo chown -R mevboost:mevboost ~/mev-boost

MEV Boost - Configure Service

Configure MEV Boost service using the command line flags.

sudo vim /etc/systemd/system/mevboost.service
/etc/systemd/system/mevboost.service
[Unit]
Description=mev-boost
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=mevboost
Group=mevboost
Restart=always
RestartSec=5

Environment=NETWORK=        # E.g. mainnet or holesky
Environment=ADDR_IP=        # E.g. 0.0.0.0
Environment=ADDR_PORT=      # Default: 18550
Environment=MIN_BID=        # E.g. 0.01
Environment=RELAYS=         # E.g. "https://<HASH>@relay.ultrasound.money"

ExecStart=/usr/local/bin/mev-boost \
    -${NETWORK} \
    -addr ${ADDR_IP}:${ADDR_PORT} \
    -min-bid ${MIN_BID} \
    -relay-check \
    -relays ${RELAYS}

[Install]
WantedBy=multi-user.target

Start the service and check it's working as expected.

daemon-reload      # Reload any changes made to the mevboost.service
mev-enable         # Enable the mevboost.service
mev-start          # Start the mevboost.service
mev-status         # View the status of the mevboost.service

mev-log            # View the mevboost.service logs

MEV Boost - Update Scripts

Create MEV Boost update script.

vim ~/mev-update.sh
~/mev-update.sh
#!/bin/bash
set -e

while true; do
    read -p "Are you sure you want to update MEV Boost? (Y/N) " yn
    case $yn in
        [Yy]* ) break;;
        [Nn]* ) exit;;
        * ) echo "Please answer Y or N.";;
    esac
done

cd ~/
sudo rm -rf mev-boost
git clone https://github.com/flashbots/mev-boost.git
cd mev-boost

read -p "Enter the commit hash you want to checkout: " commit_hash

git fetch
git checkout $commit_hash

echo
echo "*******************"
echo "Making MEV Boost..."
echo "*******************"
make build

# Check if mevboost.service exists and is running
service_was_running=0
if sudo systemctl is-active --quiet mevboost.service; then
    service_was_running=1
    echo "*********************"
    echo "Stopping MEV Boost..."
    sudo systemctl stop mevboost.service
fi

echo "Replacing previous version..."
sudo rm /usr/local/bin/mev-boost
sudo cp ~/mev-boost/mev-boost /usr/local/bin

# Only start mevboost.service if it was running originally
if [ $service_was_running -eq 1 ]; then
    echo "Restarting MEV Boost..."
    echo "***********************"
    sudo systemctl start mevboost.service
fi

Make the script executable.

chmod u+x ~/mev-update.sh

Last updated