SUI Node — 10 steps to set up Testnet Node in Service

Oleksander Siryj
2 min readFeb 11, 2023
  1. Install Linux dependencies
sudo apt-get update \
&& sudo apt-get install -y --no-install-recommends \
tzdata \
ca-certificates \
build-essential \
libssl-dev \
libclang-dev \
pkg-config \
openssl \
protobuf-compiler \
cmake

2. Install Rust

sudo curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env
rustc --version

3. Clone GitHub SUI repository

cd $HOME
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 testnet --track upstream/testnet

4. Create directory for SUI db and genesis

mkdir $HOME/.sui

5. Download genesis file

wget -O $HOME/.sui/genesis.blob  https://github.com/MystenLabs/sui-genesis/raw/main/testnet/genesis.blob

6. Make a copy of fullnode.yaml and update path to DB and genesis file in it

cp $HOME/sui/crates/sui-config/data/fullnode-template.yaml $HOME/.sui/fullnode.yaml
sed -i.bak "s|db-path:.*|db-path: \"$HOME\/.sui\/db\"| ; s|genesis-file-location:.*|genesis-file-location: \"$HOME\/.sui\/genesis.blob\"| ; s|127.0.0.1|0.0.0.0|" $HOME/.sui/fullnode.yaml

7. Add peers to fullnode.yaml

!!! check this if you are not part of incentive set

sudo tee -a $HOME/.sui/fullnode.yaml  >/dev/null <<EOF

p2p-config:
seed-peers:
- address: "/ip4/65.109.32.171/udp/8084"
- address: "/ip4/65.108.44.149/udp/8084"
- address: "/ip4/95.214.54.28/udp/8080"
- address: "/ip4/136.243.40.38/udp/8080"
- address: "/ip4/84.46.255.11/udp/8084"
- address: "/ip4/135.181.6.243/udp/8088"
EOF

8. Build SUI binaries

cargo build --release --bin sui-node
mv ~/sui/target/release/sui-node /usr/local/bin/
sui-node -V

9. Create Service file for SUI Node

echo "[Unit]
Description=Sui Node
After=network.target

[Service]
User=$USER
Type=simple
ExecStart=/usr/local/bin/sui-node --config-path $HOME/.sui/fullnode.yaml
Restart=on-failure
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target" > $HOME/suid.service

mv $HOME/suid.service /etc/systemd/system/

sudo tee <<EOF >/dev/null /etc/systemd/journald.conf
Storage=persistent
EOF

10. Start SUI Full Node in Service

sudo systemctl restart systemd-journald
sudo systemctl daemon-reload
sudo systemctl enable suid
sudo systemctl restart suid
journalctl -u suid -f

Node sync checkers:

If you see 0 tps, you need to write a script for peers and restart the node

wget -O /var/sui/fullnode.yaml https://raw.githubusercontent.com/Pa1amar/testnets/main/sui/fullnode.yaml
systemctl restart suid

--

--

Oleksander Siryj

Christian. Conservative. Father. Unapologetic. Enthusiast of cryptocurrencies. Not necessarily in that order. God bless Ukraine.