Quick Start Guide
Prerequisites
- Go >= v1.25.5
- Foundry (installation guide)
- Git LFS for circuit files
Local Development Setup
Clone and Setup Repository
# Clone the symbiotic-super-sum repository
git clone https://github.com/symbioticfi/symbiotic-super-sum.git
cd symbiotic-super-sum
# Install dependencies
git submodule update --init --recursive
Download Circuit Files
# Install Git LFS if not already installed
brew install git-lfs
git lfs install
# Download required circuit files
cd circuits
git lfs pull --include="circuit_10.pk,circuit_10.r1cs,circuit_10.vk"
cd ..
Build Contracts
forge build
Run Local Anvil Node
anvil --auto-impersonate --slots-in-an-epoch 1
Deploy Contracts
forge script script/LocalDeploy.s.sol:LocalDeploy --rpc-url http://127.0.0.1:8545 -vv --broadcast --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
Note: By default, this deploys and sets up 4 operators with a quorum threshold of 2/3+1. To modify these settings, check out script/LocalDeploy.s.sol
.
Enable Interval Mining
curl -H "Content-Type: application/json" -X POST --data \
'{"id":1337,"jsonrpc":"2.0","method":"evm_setIntervalMining","params":[1]}' \
http://localhost:8545
Important: Anvil uses on-demand mining by default, which is not compatible with relay contracts. This step is required.
Set Network Genesis
./bin/symbiotic_relay_utils network generate-genesis --chains http://127.0.0.1:8545 --driver-address 0x4826533B4897376654Bb4d4AD88B7faFD0C98528 --driver-chainid 31337 --commit --secret-keys 31337:ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
Note: If this fails, try again in 5 seconds.
Running Your First 3-node Setup
Start Relay Sidecar Nodes
The setup uses 3 nodes with different roles (quorum threshold is 2/3+1, so 3 nodes are sufficient):
Sidecar 1 (Signer only):
./bin/symbiotic_relay --config sidecar.common.yaml \
--secret-keys symb/0/15/0xde0b6b3a7640000,evm/1/31337/0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
--http-listen :8081 \
--storage-dir .data-01
Sidecar 2 (Signer + Aggregator):
./bin/symbiotic_relay --config sidecar.common.yaml \
--secret-keys symb/0/15/0xde0b6b3a7640001,evm/1/31337/0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
--http-listen :8082 \
--storage-dir .data-02 \
--aggregator true
Sidecar 3 (Signer + Committer):
./bin/symbiotic_relay --config sidecar.common.yaml \
--secret-keys symb/0/15/0xde0b6b3a7640002,evm/1/31337/0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
--http-listen :8083 \
--storage-dir .data-03 \
--committer true
Wait for all nodes to start and synchronize. You should see "valset header committed" in the committer logs (Sidecar 3).
Build Sum Node Application
cd off-chain
go build -o sum_node ./cmd/node/
Run Sum Network Nodes
Node 1 (connected with sidecar 1):
./off-chain/sum_node --evm-rpc-url http://127.0.0.1:8545 \
--relay-api-url http://localhost:8081/api/v1 \
--contract-address 0x0E801D84Fa97b50751Dbf25036d067dCf18858bF \
--private-key ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
Node 2 (connected with sidecar 2):
./off-chain/sum_node --evm-rpc-url http://127.0.0.1:8545 \
--relay-api-url http://localhost:8082/api/v1 \
--contract-address 0x0E801D84Fa97b50751Dbf25036d067dCf18858bF \
--private-key ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
Node 3 (connected with sidecar 3):
./off-chain/sum_node --evm-rpc-url http://127.0.0.1:8545 \
--relay-api-url http://localhost:8083/api/v1 \
--contract-address 0x0E801D84Fa97b50751Dbf25036d067dCf18858bF \
--private-key ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
Testing Your Setup
Request a Task
Create a simple addition task (2+2):
cast send 0x0E801D84Fa97b50751Dbf25036d067dCf18858bF "createTask(uint256,uint256)" 2 2 --rpc-url http://127.0.0.1:8545 --private-key ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
You should see related logs in both the sum nodes and sidecar nodes.
Check Task Result
cast call 0x0E801D84Fa97b50751Dbf25036d067dCf18858bF "allTaskResults(uint32)" 0 --rpc-url http://127.0.0.1:8545
Notes:
- Replace
0
with the actual task ID (sequential, starting with 0) - Results are printed in hex format
- Results can also be found in the sum node logs
Cleanup
Stop the Anvil node when done:
# If running in terminal, use Ctrl+C
# If running in background, find and kill the process
pkill -f anvil
What You've Built
This quickstart demonstrates a complete Symbiotic network setup with:
- Relay Infrastructure: 3 relay sidecar nodes with different roles (signer, aggregator, committer)
- Application Layer: Sum task network nodes that perform distributed computation
- Smart Contracts: On-chain task management and result verification
- Signature aggregation: Cryptographic signature aggregation and verification
The network can now process distributed tasks with cryptographic guarantees and fault tolerance.