Skip to main content

Build SUAVE yourself

If you'd like to run the suave-geth binaries yourself, this is the guide for you.

What you need

  1. Install Golang

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:

suave --suave.dev

What to do next

Test your node by deploying a contract and sending it some transactions:

go run suave/devenv/cmd/main.go

The output should be roughly similar to the below (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

Using the console

You can also run any familiar Geth command you like. Start by generating a new account:

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/....

You can attach to the usual Geth javascript console to get any interactive data you need with:

suave attach /tmp/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.

Troubleshooting

Go permission errors

If you are seeing:


"cp: cannot create regular file '/bin/suave': Permission denied"



it is most likely because you have not set your GOPATH correctly. You can do so by running:



export GOPATH=$HOME/go
Missing packages

If you have set up a new machine to run through this, you'll also need to install Make and Go:


sudo apt install make golang-go