Learn How to setup your Setheum Nodes


Setheum is written in Rust. A basic familiarity with Rust tooling is required.

Install Rust:

curl -sSf | sh

Clone the repo

git clone --recursive

You can install developer tools with:


sudo apt install make clang pkg-config libssl-dev build-essential


sudo dnf install make clang pkg-config libssl-dev build-essential


sudo yum install make clang pkg-config libssl-dev build-essential

You can install the latest Rust toolchain with:

make init

Build Node

Use the following command to build the node without launching it:
make build

Start a Local Dev Node

The make run command will launch a temporary node and its state will be discarded after you terminate the process.
make run

Start a Bootnode

Bootnodes are important for a healthy p2p network.
First we need to generate our persistent node key:
./target/release/setheum-node key generate-node-key
This will output the public key and the private node key:
Now we can start our boot node with the generated private key by using the --node-key flag. The --chain flag can be used for either mainnet or testnet parameters:
./target/release/setheum-node \
--chain mainnet \
--base-path ./setheum/bootnode \
--port 30333 \
--rpc-cors all \
--node-key 1ba5794ee476523629e84661ee0d28707bf43a486bb204633b789ffc226fe559 \
--name MyBootnode
This node can now be directly connected to via from another node via --bootnodes flag:
./target/release/setheum-node \
--chain mainnet \
--base-path ./setheum/bootnode \
--port 30333 \
--rpc-cors all \
--bootnodes /ip4/<MyBootNode-IP-ADDRESS>/tcp/30333/p2p/12D3KooWL4scSWDRaTNja1KH4Rnv7JxVKGkrSvr9XH8Li8yL5mCA
--name MyOtherBootnode
💡 You can also point a domain name to your node's ip and then reference it as /dns/

Start an Archive RPC Node

The Setheum mainnet or testnet RPC node can be started like so:
./target/release/setheum-node \
--chain mainnet \
--base-path ./setheum/fullnode \
--pruning=archive \
--port 30333 \
--ws-port 9944 \
--rpc-port 9933 \
--rpc-methods Auto \
--rpc-cors all \
--rpc-external \
--ws-external \
--name "My RPC Node"
To make the node archival (for use with indexers or block explorers) we use the --pruning=archive flag. Omit this flag to run the light RPC node.
Additionally, you may want to configure nginx frontend with TLS. See an example.

Start a Validator Node

Please check our validator guide on how to setup and configure a validator node.

Reset the chain state

To prune (reset) the node run:
./target/release/setheum-node purge-chain --chain <dev/testnet/mainnet> --base-path /path/to/state
For example, to prune our sample "My RPC Node" chain:
./target/release/setheum-node purge-chain --dev --base-path /setheum/fullnode