Run SUAVE Locally
You can use suave-geth
to start a local SUAVE devnet.
There are two ways to work with suave-geth
:
- β‘ Install the latest release binary
- π§ββοΈ Build from source
Latest release binaryβ
curl -L https://suaveup.flashbots.net | bash
Start your local devnet with:
suave-geth --suave.dev
Using --suave.dev
will run suave-geth with the following flags:
./build/bin/geth --dev --http --http.addr "0.0.0.0" --http.api "suavex,debug,suavey,eth"
--http.corsdomain "*" --http.vhosts "*" --ws --ws.addr "0.0.0.0" --ws.origins "*"
--keystore "/tmp/suave-dev/keystore" --unlock "0xB5fEAfbDD752ad52Afb7e1bD2E40432A485bBB7F"
--password "/tmp/suave-dev/password.txt" --miner.gaslimit "30000000"
Building from sourceβ
We recommend that you use Golang v1.21 or newer.
Clone the suave-geth repository:
git clone git@github.com:flashbots/suave-geth.git
cd suave-geth
Build the binary:
make suave
Start the local devnet with:
./build/bin/suave-geth --suave.dev
You can check that the suave
binary is available in ./build/bin/
with:
./build/bin/suave-geth --version
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
Testing the devnetβ
Compile the example contracts:
What is Forge?
forge
is a part of the smart contract development toolchain we use in our examples, which you can learn more about in our next tutorial. If you do not have it installed, you can do so quickly with:
curl -L https://foundry.paradigm.xyz | bash
cd suave && forge build
Create a few example transactions:
go run devenv/cmd/main.go
Execute a RPC request with curl like this:
curl 'http://localhost:8545' --header 'Content-Type: application/json' --data '{ "jsonrpc":"2.0", "method":"eth_blockNumber", "params":[], "id":83 }'
If you built from source (but not if you're running Docker), you can attach to the usual Geth javascript console to get any interactive data you need with:
./build/bin/suave-geth attach /tmp/geth.ipc
IPC not found
It may be the case, especially if you have a custom GOPATH, that the geth.ipc is somewhere else. You can either force the path using the --ipcpath
flag when starting SUAVE, or find the path in the logs (it could look something like /System/Volumes/Data/private/var/folders/rt/gq5bhvy17wz5z5dl32_x83dw0000gp/T/geth.ipc
, for instance).
From within the console, you can run:
eth.accounts[0]
This should return "0xb5feafbdd752ad52afb7e1bd2e40432a485bbb7f"
- the default funded account for local development.
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.
Dev infoβ
The local devnet setup funds a dev account for you by default, as well as setting up a Kettle for you to submit Confidential Compute Requests to when interacting with your contracts. Your local address and the Kettle created for your local devnet are listed below:
Local dev accountβ
The address is:
0xBE69d72ca5f88aCba033a063dF5DBe43a4148De0
The private key is:
0x91ab9a7e53c220e6210460b65a7a3bb2ca181412a8a7b43ff336b3df1737ce12
Local Kettleβ
The address is:
0xB5fEAfbDD752ad52Afb7e1bD2E40432A485bBB7F
The private key is:
0x6c45335a22461ccdb978b78ab61b238bad2fae4544fb55c14eb096c875ccfc52
What am I actually running?β
The main actor in the SUAVE protocol is called a "Kettle". Kettles house all components necessary to perform confidential compute.
Here is the architecture of a Kettle on the Toliman Testnet. When you start a local SUAVE devnet, you're running all the stuff in the purple square (but not the domain specific services, i.e. nodes connected to other chains from/to which you wish to receive or send bundles).
You can read more about exactly what a Kettle contains in architecture section of the Technical Specs.