Blog

Sui Full Node Setup

Preparation

Server

Suggested minimum hardware to run a Sui Full node:

CPUs: 8 physical cores / 16 vCPUs RAM: 128 GB Storage (SSD): 4 TB NVMe drive

Bare Metal Server Providers:

All of this needs KYC process.

Setup

Env

Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Brew(Optional)

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Packages

sudo apt-get update \
&& sudo apt-get install -y --no-install-recommends \
tzdata \
libprotobuf-dev \
ca-certificates \
build-essential \
libssl-dev \
libclang-dev \
libpq-dev \
pkg-config \
openssl \
protobuf-compiler \
git \
clang \
cmake

Sui Cli

  1. Download binary files from https://github.com/MystenLabs/sui/releases.
  2. Add PATH variable to you local system, such as ~/.bashrc.

https://docs.sui.io/guides/developer/getting-started/sui-install

Genesis Blob

  • Devnet genesis blob: curl -fLJO https://github.com/MystenLabs/sui-genesis/raw/main/devnet/genesis.blob
  • Testnet genesis blob: curl -fLJO https://github.com/MystenLabs/sui-genesis/raw/main/testnet/genesis.blob
  • Mainnet genesis blob: curl -fLJO https://github.com/MystenLabs/sui-genesis/raw/main/mainnet/genesis.blob

Full Node Yaml

wget https://github.com/MystenLabs/sui/blob/main/crates/sui-config/data/fullnode-template.yaml

Change yaml config, such as:

# Update this value to the location you want Sui to store its database
db-path: "/home/ubuntu/sui/db"

# For ipv4, update this to "/ip4/X.X.X.X/tcp/8080/http"
network-address: "/ip4/X.X.X.X/tcp/8080/http"
metrics-address: "0.0.0.0:9184"
# this address is also used for web socket connections
json-rpc-address: "0.0.0.0:9000"
enable-event-processing: true

p2p-config:
  listen-address: "0.0.0.0:8084"
  # add state-sync seed peers below
  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

genesis:
  # Update this to the location of where the genesis file is stored
  genesis-file-location: "/home/ubuntu/sui/genesis.blob"

authority-store-pruning-config:
  num-latest-epoch-dbs-to-retain: 3
  epoch-db-pruning-period-secs: 3600
  num-epochs-to-retain: 1
  max-checkpoints-in-batch: 10
  max-transactions-in-batch: 1000
  pruning-run-delay-seconds: 60

state-archive-read-config:
  - object-store-config:
      object-store: "S3"
      # Use mysten-testnet-archives for testnet 
      # Use mysten-mainnet-archives for mainnet
      bucket: "mysten-mainnet-archives"
      # you can either provide your own aws credentials via "aws-secret-access-key" and
      # "aws-access-key-id" or set no-sign-request: true
      no-sign-request: true
      aws-region: "us-west-2"
      object-store-connection-limit: 20
    # How many objects to read ahead when catching up  
    concurrency: 5
    # Whether to prune local state based on latest checkpoint in archive.
    # This should stay false for most use cases
    use-for-pruning-watermark: false

Important fields:

  • db-path
  • network-address
  • genesis.genesis-file-location

Download Snapshots

sui-tool download-db-snapshot --latest \
    --network <NETWORK> --snapshot-bucket <BUCKET-NAME> \
    --snapshot-bucket-type <TYPE> --path <PATH-TO-NODE-DB> \
    --num-parallel-downloads 25 \
    --skip-indexes \
    --no-sign-request

https://docs.sui.io/guides/operator/snapshots

For free download command like:

sui-tool download-formal-snapshot --latest --genesis "/home/ubuntu/sui/genesis.blob" \
     --network mainnet \
     --path /home/ubuntu/sui/db --num-parallel-downloads 50 --no-sign-request

Start

sui-node --config-path fullnode.yaml

It takes some time for the node to synchronize to the latest state.

Check

Metrics

http://127.0.0.1:9184/metrics

Checkpoint

curl -X POST http://localhost:9000 -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"sui_getLatestCheckpointSequenceNumber","params":[]}'

Compare this with the value on the sui explorer.

SUITESTER

https://node.sui.zvalid.com

Refs