Nodes
Learn How to setup your Setheum Nodes
curl https://sh.rustup.rs -sSf | sh
git clone --recursive https://github.com/Setheum-Labs/Setheum
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
make init
Use the following command to build the node without launching it:
make build
The
make run
command will launch a temporary node and its state will be discarded after you terminate the process.make run
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:
12D3KooWL4scSWDRaTNja1KH4Rnv7JxVKGkrSvr9XH8Li8yL5mCA
1ba5794ee476523629e84661ee0d28707bf43a486bb204633b789ffc226fe559
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/bootnode.mydomain.com/tcp/30333/...
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.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
Last modified 1yr ago