Sui devnet

This guide for nonincentivized SUI devnet

Guide was successfully tested on several dedicated servers (Hetzner AX41-NVMe, AX51-NVMe, AX101) and Hetzner Cloud VPS: CPX31, CX41, CPX41 and CPX51.

Requirements

This is official requirement for devnet node:

CPU: 2vCPU

RAM: 8 GB RAM

SSD: 50 GB SSD

OS: Ubuntu 20.04 LTS

Installation

Step 1. Install packages and updates (including RUST)

sudo apt update && sudo apt upgrade -y
sudo apt install make clang pkg-config libssl-dev libclang-dev build-essential git curl ntp jq llvm tmux htop screen unzip cargo cmake -y
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

Step 2. Install SUI node

mkdir .sui
git clone https://github.com/MystenLabs/sui.git
cd sui
git remote add upstream https://github.com/MystenLabs/sui
git fetch upstream
git checkout -B devnet --track upstream/devnet
cp crates/sui-config/data/fullnode-template.yaml fullnode.yaml
curl -fLJO https://github.com/MystenLabs/sui-genesis/raw/main/devnet/genesis.blob
cargo build --release -p sui-node
Step 3. Configure your node

cd
mv sui/fullnode.yaml .sui
mv sui/genesis.blob .sui
nano .sui/fullnode.yaml
#Open file, replace genesis-file-location: "genesis.blob" on genesis-file-location: "/root/.sui/genesis.blob" and save


cp sui/target/release/sui-node /usr/bin
#Create systmed file. 
tee /etc/systemd/system/suid.service > /dev/null <<EOF
[Unit]
Description=sui
After=network-online.target
[Service]
User=root
ExecStart=/usr/bin/sui-node --config-path /root/.sui/fullnode.yaml
Restart=always
RestartSec=3
LimitNOFILE=10000
[Install]
WantedBy=multi-user.target
EOF
Step 4. Run your node

sed -i.bak "s/127.0.0.1/0.0.0.0/" /root/.sui/fullnode.yaml
systemctl daemon-reload
systemctl enable suid
systemctl start suid
journalctl -u suid -f

Updating your node

If you need to update your node, run following commands:

systemctl stop suid
rm -rf /suidb
rm -rf /root/sui/suidb/
rm -rf /root/.sui/genesis.blob
wget -O /root/.sui/genesis.blob https://github.com/MystenLabs/sui-genesis/raw/main/devnet/genesis.blob
cd sui
git fetch upstream
git stash
git checkout -B devnet --track upstream/devnet
cargo build --release -p sui-node
cp target/release/sui-node /usr/bin
systemctl restart suid
journalctl -u suid -f

Check version of your node

curl -s -X POST http://127.0.0.1:9000/ -H 'Content-Type: application/json' -d '{ "jsonrpc":"2.0", "method":"rpc.discover","id":1}' | jq .result.info

Deleting your node

systemctl stop suid
rm -rf /suidb
rm -rf sui
rm -rf .sui
rm -rf /etc/systemd/system/suid.service