Eridian
eridian.xyzx.comGitHub
  • 📖Eridian Docs
  • Ethereum Dev
    • ✏️Ethereum Notes
      • 🎛️Technical Basics
      • 🪧Ethereum Addresses
      • 📚Ethereum State Explained
      • ⛽Gas Fees Explained
    • 🔧Useful Tools
      • ☁️Ethers
      • *️⃣Ethernal
    • 📝Solidity Notes
      • ❔Interview Questions
        • 🟢1. Easy - Interview Questions
        • 🟠2. Medium - Interview Questions
        • 🟡3. Hard - Interview Questions
        • 🔴4. Advanced - Interview Questions
      • 💡Note Ideas
      • ABI
      • abi.encodePacked
      • Abstract Contracts
      • Arrays
      • Casting
      • CEI - Checks, Effects, Interactions
      • Comments (NATSPEC)
      • Constructor
      • Contract Structure & Versions
      • Data - Storage vs Memory
      • Data - Storage Layout
      • Enum
      • Errors (require & revert)
      • Events
      • EVM Opcodes
      • External Contract Interaction
      • 🏗️External Dependencies
      • Functions
      • Function Modifiers
      • If / Else / For / While Loops
      • Inheritance
      • Interfaces
      • Keccak256
      • Library
      • Mappings
      • msg.sender
      • Objects & Types
      • OpenZeppelin
      • Payable
      • Public State Variable vs Function
      • Receive & Fallback
      • Security
      • Self Destruct
      • Send ETH (transfer, send, call)
      • Stack Too Deep
      • Structs
      • Style Guide
      • Time Units
      • Try / Catch
      • Typecasting
      • Using Directive
      • Variables, Consts & Immutable
      • Withdraws
    • ⚒️Foundry Notes
      • 📖Docs & GitHub Pages
      • 🤝Useful Commands
        • 🔨Anvil
        • 🪄Cast
        • 🔥Forge
      • 🧪Tests
        • Cheatcodes
      • 📝Useful Scripts
        • Deploy Contract Using Hex
    • 👾DeFi Challenges
      • 👨‍🚀Ethernaut
        • Ethernaut - Template
        • Level 1 - Fallback ⏺
        • Level 2 - Fallout ⏺
        • Level 3 - Coin Flip ⏺⏺
        • Level 4 - Telephone ⏺
        • Level 5 - Token ⏺⏺
        • Level 6 - Delegation ⏺⏺
        • Level 7 - Force ⏺⏺⏺
        • Level 8 - Vault ⏺⏺
        • Level 9 - King ⏺⏺⏺
        • Level 10 - Re-entrancy ⏺⏺⏺
        • Level 11 - Elevator ⏺⏺
        • Level 12 - Privacy ⏺⏺⏺
        • Level 13 - Gatekeeper 1 ⏺⏺⏺⏺
        • Level 14 - Gatekeeper 2 ⏺⏺⏺
        • Level 15 - Naught Coin ⏺⏺⏺
        • Level 16 - Preservation ⏺⏺⏺⏺
        • Level 17 - Recovery ⏺⏺⏺
        • Level 18 - Magic Number ⏺⏺⏺
        • Level 19 - Alien Codex ⏺⏺⏺⏺
        • Level 20 - Denial ⏺⏺⏺
        • Level 21 - Shop ⏺⏺
        • Level 22 - Dex ⏺⏺
        • Level 23 - Dex Two ⏺⏺
        • Level 24 - Puzzle Wallet ⏺⏺⏺⏺
        • Level 25 - Motorbike ⏺⏺⏺
        • Level 26 - DoubleEntryPoint ⏺⏺
        • Level 27 - Good Samaritan ⏺⏺⏺
        • Level 28 - Gatekeeper 3 ⏺⏺⏺
        • Level 29 - Switch ⏺⏺⏺⏺
        • Level 30 - Higher Order ⏺⏺⏺⏺
        • Level 31 - Stake ⏺⏺⏺
      • 💸Damn Vulnerable DeFi
    • 🔍Auditing
      • 🗞️Exploit Resources
      • 🔧Audit Tools
    • 🤖MEV
  • Infrastructure Docs
    • 💻Hardware
    • 🐧Linux
      • 📖Linux Glossary
      • ⌨️Linux Commands
      • 💾Installation
      • 🏗️Maintenance
      • 🖥️Ubuntu Desktop
      • 🛜ZeroTier
      • 🎞️TMUX
      • 🔵Bluetooth
    • ⛓️Ethereum Clients
      • ⚙️Execution Clients
        • ⛏️Geth
          • 💾Installation
          • ⌨️Useful Commands
          • 🏗️Maintenance
        • 🐻Erigon
          • 💾Installation
          • ⌨️Useful Commands
          • 🏗️Maintenance
        • 🧶Besu
          • 💾Installation
          • ⌨️Useful Commands
          • 🏗️Maintenance
      • 🤝Beacon Clients
        • 💡Lighthouse
          • 💾Installation
          • ⌨️Useful Commands
          • 🏗️Maintenance
        • 🪅Teku
          • 💾Installation
          • ⌨️Useful Commands
          • 🏗️Maintenance
      • 💎Validator Clients
        • 💡Lighthouse
          • 💾Installation
          • ⌨️Useful Commands
          • 🏗️Maintenance
      • ➕L2 Clients
        • 🔵Base
          • 💾Installation
          • ⌨️Useful Commands
          • 🏗️Maintenance
      • 💰MEV Boost
        • 💾Installation
        • 🏗️Maintenance
    • 🚨Alerting and Monitoring
      • 🔥Prometheus
      • 🌡️HealthChecks.io
      • 📟PagerDuty
  • General Dev
    • 💾Git Notes
      • Repos
      • Committing changes
      • Branches
      • Merging & Rebasing
      • PRs
Powered by GitBook
On this page
  • Create Aliases
  • MEV Boost - Install
  • MEV Boost - Configure Service
  • MEV Boost - Update Scripts
Edit on GitHub
  1. Infrastructure Docs
  2. Ethereum Clients
  3. MEV Boost

Installation

MEV Boost client installation guide.

Last updated 1 year ago

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

/usr/local/bin/mev-boost

Starts MEV Boost.

-${NETWORK}

Specifies the target network.

-addr

Set listening port.

-min-bid

Sets the minimum bid that needs to be offered to accept a block from the relay. If no offer is higher than the min-bid then the validator will build its own block locally.

-relay-check

MEV Boost pings the relays to check they are still alive.

-relays

Comma separated list of relay addresses.

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
sudo systemctl daemon-reload                              # Reload any changes made to the mevboost.service
sudo systemctl enable mevboost.service                    # Enable the mevboost.service
sudo systemctl start mevboost.service                     # Start the mevboost.service
sudo systemctl status mevboost.service                    # View the status of the mevboost.service

sudo journalctl -f -u mevboost.service -o cat | ccze -A   # 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
⛓️
💰
💾
Create Aliases
Firewall Configuration
MEV Boost - Install
MEV Boost - Configure Service
MEV Boost - Update Scripts