Sui

Instructions to set up your Sui node.

Requirements

Prerequisites

sudo apt-get install jq -y

Install Sui

Check the appropriate version for the network accordingly in their docs

# This is an example - check their docs and release page to opt for the right version
SUI_SHA=2aadf14aab3a5174d219131058e032533ab3bcd0
# verify correct version
echo SUI_SHA

# create a temp dir for binaries
cd $HOME
mkdir binaries && cd binaries

# if you are on linux amd
wget https://releases.sui.io/$SUI_SHA/sui-node https://releases.sui.io/$SUI_SHA/sui
chmod +x *
sudo mv * /usr/bin/
# verify version
sui-node --version
cd $HOME

Download genesis and config files

mkdir -p /opt/sui/config/
cd /opt/sui/config/
curl -fLJO https://github.com/MystenLabs/sui-genesis/raw/main/mainnet/genesis.blob
wget -O fullnode.yaml https://raw.githubusercontent.com/MystenLabs/sui/main/crates/sui-config/data/fullnode-template.yaml
ls
mkdir -p /opt/sui/config/
cd /opt/sui/config/
curl -fLJO https://github.com/MystenLabs/sui-genesis/raw/main/testnet/genesis.blob
wget -O fullnode.yaml https://raw.githubusercontent.com/MystenLabs/sui/main/crates/sui-config/data/fullnode-template.yaml
ls

Edit the fullnode.yaml file to include peer nodes for state synchronization. Append the following to the end of the current configuration

p2p-config:
    seed-peers:
    - address: /dns/mel-00.mainnet.sui.io/udp/8084
    peer-id: d32b55bdf1737ec415df8c88b3bf91e194b59ee3127e3f38ea46fd88ba2e7849
    - address: /dns/ewr-00.mainnet.sui.io/udp/8084
    peer-id: c7bf6cb93ca8fdda655c47ebb85ace28e6931464564332bf63e27e90199c50ee
    - address: /dns/ewr-01.mainnet.sui.io/udp/8084
    peer-id: 3227f8a05f0faa1a197c075d31135a366a1c6f3d4872cb8af66c14dea3e0eb66
    - address: /dns/lhr-00.mainnet.sui.io/udp/8084
    peer-id: c619a5e0f8f36eac45118c1f8bda28f0f508e2839042781f1d4a9818043f732c
    - address: /dns/sui-mainnet-ssfn-1.nodeinfra.com/udp/8084
    peer-id: 0c52ca8d2b9f51be4a50eb44ace863c05aadc940a7bd15d4d3f498deb81d7fc6
    - address: /dns/sui-mainnet-ssfn-2.nodeinfra.com/udp/8084
    peer-id: 1dbc28c105aa7eb9d1d3ac07ae663ea638d91f2b99c076a52bbded296bd3ed5c
    - address: /dns/sui-mainnet-ssfn-ashburn-na.overclock.run/udp/8084
    peer-id: 5ff8461ab527a8f241767b268c7aaf24d0312c7b923913dd3c11ee67ef181e45
    - address: /dns/sui-mainnet-ssfn-dallas-na.overclock.run/udp/8084
    peer-id: e1a4f40d66f1c89559a195352ba9ff84aec28abab1d3aa1c491901a252acefa6
    - address: /dns/ssn01.mainnet.sui.rpcpool.com/udp/8084
    peer-id: fadb7ccb0b7fc99223419176e707f5122fef4ea686eb8e80d1778588bf5a0bcd
    - address: /dns/ssn02.mainnet.sui.rpcpool.com/udp/8084
    peer-id: 13783584a90025b87d4604f1991252221e5fd88cab40001642f4b00111ae9b7e
p2p-config:
    seed-peers:
    - address: /dns/yto-tnt-ssfn-01.testnet.sui.io/udp/8084
    peer-id: 2ed53564d5581ded9b6773970ac2f1c84d39f9edf01308ff5a1ffe09b1add7b3
    - address: /dns/yto-tnt-ssfn-00.testnet.sui.io/udp/8084
    peer-id: 6563732e5ab33b4ae09c73a98fd37499b71b8f03c27b5cc51acc26934974aff2
    - address: /dns/nrt-tnt-ssfn-00.testnet.sui.io/udp/8084
    peer-id: 23a1f7cd901b6277cbedaa986b3fc183f171d800cabba863d48f698f518967e1
    - address: /dns/ewr-tnt-ssfn-00.testnet.sui.io/udp/8084
    peer-id: df8a8d128051c249e224f95fcc463f518a0ebed8986bbdcc11ed751181fecd38
    - address: /dns/lax-tnt-ssfn-00.testnet.sui.io/udp/8084
    peer-id: f9a72a0a6c17eed09c27898eab389add704777c03e135846da2428f516a0c11d
    - address: /dns/lhr-tnt-ssfn-00.testnet.sui.io/udp/8084
    peer-id: 9393d6056bb9c9d8475a3cf3525c747257f17c6a698a7062cbbd1875bc6ef71e
    - address: /dns/mel-tnt-ssfn-00.testnet.sui.io/udp/8084
    peer-id: c88742f46e66a11cb8c84aca488065661401ef66f726cb9afeb8a5786d83456e

Setup systemd

Create the systemd service file /etc/systemd/system/sui.service

sudo tee /etc/systemd/system/suid.service &>/dev/null <<EOF
[Unit]
Description=Sui Node

[Service]
User=$USER
WorkingDirectory=/opt/sui/
Environment=RUST_BACKTRACE=1
Environment=RUST_LOG=info,sui_core=debug,narwhal=debug,narwhal-primary::helper=info,LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so,MALLOC_CONF=prof:true,prof_prefix:/opt/sui/jeprof/jeprof.out,lg_prof_interval:36
ExecStart=/usr/bin/sui-node --config-path /opt/sui/config/fullnode.yaml
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

Start the service

sudo systemctl daemon-reload
sudo systemctl enable suid
sudo systemctl restart suid

Check logs

# change log settings to persistent if not already
sed -i 's/#Storage=auto/Storage=persistent/g' /etc/systemd/journald.conf
sudo systemctl restart systemd-journald
journalctl -u suid.service -f -n 100 -o cat

Logs should appear like this

2024-05-13T15:42:10.253723Z  INFO sui_core::authority::authority_store: Cur epoch: 0
2024-05-13T15:42:11.339716Z  INFO AuthorityPerEpochStore::new{epoch=0}: sui_core::authority::authority_per_epoch_store: authenticator_state disabled
2024-05-13T15:42:12.274692Z  WARN anemo::network: msg="expected socket send buffer size to be at least 20971520, got 425984"
2024-05-13T15:42:12.274704Z  WARN anemo::network: msg="expected socket receive buffer size to be at least 20971520, got 425984"
2024-05-13T15:42:12.274821Z  INFO sui_node: P2p network started on 0.0.0.0:8080 server_name="sui-35834a8a"
2024-05-13T15:42:12.274857Z  INFO sui_network::discovery: Discovery started
2024-05-13T15:42:12.274870Z  INFO connection-manager{peer=b99cd7fa}: anemo::network::connection_manager: ConnectionManager started
2024-05-13T15:42:12.274871Z  INFO sui_network::state_sync: State-Synchronizer started
2024-05-13T15:42:12.274899Z  INFO sui_core::authority: current protocol version is now ProtocolVersion(4)
2024-05-13T15:42:12.274903Z  INFO sui_core::authority: supported versions are: SupportedProtocolVersions { min: ProtocolVersion(1), max: ProtocolVersion(44) }

Verify RPC

Once your sui node is fully synced, you can run a cURL request to see the latest epoch on your node:

curl -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "suix_getLatestSuiSystemState",
  "params": []
}' localhost:9000 | jq .result.epoch

Compare the epoch number with explorer

Configure vald

In order for vald to connect to your node, your rpc_addr should be exposed in vald’s config.toml

[[QP_bridge_evm]]
name = "sui"
rpc_addr = "http://IP:9000"
start-with-bridge = true
[[QP_bridge_evm]]
name = "sui"
rpc_addr = "http://IP:9000"
start-with-bridge = true
Edit this page