> For the complete documentation index, see [llms.txt](https://dinhcongtac221.gitbook.io/about/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dinhcongtac221.gitbook.io/about/testnet-network/sui.md).

# Sui

#### 1. Installing the required 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


curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
```

\####2. Clone the sui repository

```
git clone https://github.com/MystenLabs/sui.git
cd sui
```

\###3. Create a of the configuration template

```
cp crates/sui-config/data/fullnode-template.yaml fullnode.yaml
```

\###4. Downloading genesis.blob for Testnet

```
curl -fLJO https://github.com/MystenLabs/sui-genesis/raw/main/testnet/genesis.blob
```

\###5. Edit the main configuration of the SUI node

```
nano fullnode.yaml
```

Example node config (adjust paths as needed):

yaml

```
db-path: "/opt/sui/db"

network-address: "/dns/localhost/tcp/8080/http"
metrics-address: "0.0.0.0:9184"
json-rpc-address: "0.0.0.0:9000"
enable-event-processing: true

p2p-config:
  listen-address: "0.0.0.0:8084"
  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

genesis:
  genesis-file-location: "/opt/sui/config/genesis.blob"

authority-store-pruning-config:
  num-latest-epoch-dbs-to-retain: 6
  epoch-db-pruning-period-secs: 10800
  num-epochs-to-retain: 3
  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"
      bucket: "mysten-testnet-archives"
      no-sign-request: true
      aws-region: "us-west-2"
      object-store-connection-limit: 20
    concurrency: 5
    use-for-pruning-watermark: false

```

\###6. Create folders & files to target

```
sudo mkdir -p /opt/sui/db
sudo mkdir -p /opt/sui/config
sudo chmod -R 777 /opt/sui

cp sui/fullnode.yaml /opt/sui/config/
cp sui/genesis.blob /opt/sui/config/
```

\###7. Building and installing the Sui node binary

```
cd sui
cargo build --release
./target/release/sui-node --version

sudo cp ./target/release/sui-node /usr/local/bin/
sudo chmod +x /usr/local/bin/sui-node
```

\###8. Downloading snapshot\
Note that at the time the node was installed, 657 epoch was current.

```
export PATH=$PATH:/root/sui/target/release
sudo cp /root/sui/target/release/sui-tool /usr/local/bin/
sudo chmod +x /usr/local/bin/sui-tool

sui-tool download-formal-snapshot \
    --epoch 657 \
    --genesis "/opt/sui/config/genesis.blob" \
    --network testnet \
    --path "/opt/sui/db" \
    --num-parallel-downloads 50 \
    --no-sign-request
```

The process of downloading the snapshot took me about 2 hours.

Setting up and running the Sui Full Node as a systemd service

\###9. Create a systemd service file for Sui Node

```
sudo nano /etc/systemd/system/sui-node.service
```

Paste the following:

```
[Unit]
Description=Sui Full Node
After=network.target

[Service]
User=root
ExecStart=/usr/local/bin/sui-node --config-path /opt/sui/config/fullnode.yaml
Restart=always
LimitNOFILE=1000000

[Install]
WantedBy=multi-user.target
```

\###10. Reload & Enable & Start

```
sudo systemctl daemon-reload
sudo systemctl enable sui-node
sudo systemctl start sui-node
```

Useful commands\
Retrieve and monitor Sui Node metrics:

```
curl 127.0.0.1:9184/metrics 2>/dev/null | grep -E \
    "^last_executed_checkpoint|\ 
    ^highest_synced_checkpoint|\ 
    ^last_committed_round|\ 
    ^current_round|\ 
    ^highest_received_round|\ 
    ^certificates_created|\ 
    ^uptime"
```

View logs:

```
journalctl -u sui-node -f -o cat
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dinhcongtac221.gitbook.io/about/testnet-network/sui.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
