Run SUAVE Locally
Our goal in this guide is to get SUAVE running locally.
You can read more about exactly what you'll be running in the architecture section of the Technical Specs.
Docker​
What you need​
- Install and start Docker. You can find general directions here.
- If you're running Ubuntu or Debian, we recommend this specific guide.
- Make sure you have
docker-compose
installed too. The should just happen when you install Docker.- Check with
docker-compose version
(Docker Engine) ordocker compose version
(Docker Desktop).
- Check with
- We do not have high RAM, disk, or bandwidth requirements. This section should work on most consumer laptops.
What to do​
- Clone suave-geth:
git clone https://github.com/flashbots/suave-geth.git
- Get to the right place in the repo:
cd suave-geth/
- Run SUAVE (depending on your docker setup, you may need to run this as
sudo
):
make devnet-up
Optional testing​
- Test your node by deploying a contract and sending it some transactions:
go run suave/devenv/cmd/main.go
You should see something like the below printed to your terminal (addresses, txns, and ids will differ):
suave-geth$ go run suave/devenv/cmd/main.go
Step 0: Create and fund test accounts
- Funded test account: 0x66d5a8D6B34329c0639071275b3d78D29e11EbC6 (100000000)
Step 1: Deploy mev-share contract
- Mev share contract deployed: 0x8f21Fdd6B4f4CacD33151777A46c122797c8BF17
Step 2: Send bid
- Bid sent at txn: 0xb49debcdead2b306d6ab6282b88fdad7c8d6a33d87df34b79f56d141eae7c08a
- Bid id: 30bbc65298f24e67aaf5c95bf5f0686c
Step 3: Send backrun
- Backrun sent at txn: 0xcf7880e61e94aaab48c60655c321716ecab6edab752586448b0412e93a969889
- Backrun bid id: db98b83d02694fc2b13c042ad22c233
If you'd like to examine the Go code responsible for deploying contracts and sending transactions, you can do so here.
You can also navigate to http://localhost:8080 in your browser to see a local block explorer.
- You can stop your docker containers with:
make devnet-down
Common problems​
1. Docker not running
sudo systemctl start docker
You can check the current status with:
sudo systemctl status docker
2. Unsupported version
ERROR: Version in "././suave/devenv/docker-compose.yml" is unsupported.
Simply go to the file in
/suave/devenv/docker-compose.yml
and change the first line to use 3.3
rather than 3.8
.Build it yourself​
If you'd like to run the suave-geth binaries yourself, read on.
What you need​
What to do​
- Clone the repo and build SUAVE:
git clone https://github.com/flashbots/suave-geth.git
cd suave-geth
make suave
- Run this command:
./build/bin/suave --suave.dev
What to do next​
In another terminal, you can run:
go run suave/devenv/cmd/main.go
The output should be roughly similar to the one printed above (addresses, txns, and ids will differ).
You can also run any familiar Geth command you like. Start by generating a new account:
./build/bin/suave --suave account new
If the --datadir
flag is not set, a geth client stores data in the $HOME/.ethereum
directory. Depending on the chain you use, it creates a subdirectory. For example, if you run Sepolia, geth creates $HOME/.ethereum/sepolia/
. So, if you use the --suave
flag, your data ends up in $HOME/.ethereum/suave/...
.
Using the console​
You can attach to the usual Geth javascript console to get any interactive data you need with:
./build/bin/suave attach ./suave/geth.ipc
From within the console, you can run:
eth.accounts[0]
Which should return "0xb5feafbdd752ad52afb7e1bd2e40432a485bbb7f"
which is the account we unlocked when starting the MEVM.
eth.getBalance(eth.accounts[0])
Should return a really large number 1.1579...e+77
. If you try eth.getBalance("<your_new_address>")
instead, you should see 0
.
If you try:
web3.eth.blockNumber
It should tell you the block height of your local network.