Run SUAVE Locally
Our first goal is to start a "Kettle". Kettles house all components necessary to perform confidential compute and are the main protocol actor in the SUAVE protocol.
Here is the architecture of a node on the Rigil Testnet. We'll be running all the stuff within the purple square.
You can read more about exactly what a Kettle contains in architecture section of the Technical Specs.
Get Startedβ
There are two different approaches you can take to local setup:
Clone the suave-geth repositoryβ
git clone git@github.com:flashbots/suave-geth.git
Building from sourceβ
Build the binary:
cd suave-geth && make suave
Now you have the suave
binary in your Go bin directory. You can check this by running:
which suave
suave --version
Start the local devnet with:
suave --suave.dev
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
Using Dockerβ
Spin up the local devnet with docker-compose:
make devnet-up
You can check that the containers are running with:
docker ps
And you can stop the local devnet with:
make devnet-down
On MacOS, the above should work out of the box with Docker Desktop. If you're using Linux, you may run into some of the issues below:
1. Docker permission errors
On Linux, it is best to create a new user group for Docker, rather than run the above command as sudo. You can do by running:
sudo usermod -aG docker $USER newgrp docker
2. Docker not running
Make sure that Docker is running. On most Linux machines, you can do this with:
sudo systemctl start dockerYou can check the current status with:
sudo systemctl status dockerIf you installed Docker and still run into issues with docker-compose, you can try:
sudo apt install docker-compose
3. Unsupported version
If you're running an older version of Docker, you may get a message that looks like this:
ERROR: Version in "././suave/devenv/docker-compose.yml" is unsupported.
Go to the file in "/suave/devenv/docker-compose.yml" and change the first line to use 3.3 rather than 3.8.
Testing the devnetβ
Create a few example transactions:
go run suave/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:
suave attach /tmp/geth.ipc
From within the console, you can run:
eth.accounts[0]
This should return "0xb5feafbdd752ad52afb7e1bd2e40432a485bbb7f"
- the defaul 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.