# Sui FullNodeの建て方

By [qyeah](https://paragraph.com/@qyeah) · 2022-06-23

---

1\. 目的
------

SuiのFullNodeの構築方法を記載します 今後dockerもサポートするとのことですが、現時点ではSource CodeからのBuild方法を記載します

また、Suiにおいても報酬付きのテストネットが開かれる予定ですが、参加には開発者ネットでのFullNode構築が必須なので、ぜひノードを建ててみてください

### 1-1. 初心者の方

簡単にNodeを建てることができるinstaller作成しました 動作させるCodeはこちらです

> \[注意事項\]
> 
> Node構築に際して、簡易なinstallerはSui以外にもよく見られます 多くの場合には、悪意のない人が善意で作成しているものです ただし、まれに悪意のあるコードを仕込んでいる人もいます できれば元のコードと公式のDocumentを比較して、あからさまに異なる箇所がないか確認する習慣をつけてください

[https://github.com/qyeah98/sui-installer/blob/main/install-sui-fullnode.sh](https://github.com/qyeah98/sui-installer/blob/main/install-sui-fullnode.sh)

### 1-2. エンジニアの方

公式のGithubに詳細手順があるため、そちらもぜひ確認してください

[https://github.com/MystenLabs/sui/blob/main/doc/src/build/fullnode.md](https://github.com/MystenLabs/sui/blob/main/doc/src/build/fullnode.md)

![](https://storage.googleapis.com/papyrus_images/be08777ee56b0e9ae77a8250b6474bb8a3c57a574df7e23bb6864f5a17def5fc.png)

2\. 手順
------

### 2-1. サーバの準備

サーバの準備が必要になります こちらの記事を参考にして、サーバを用意してください

サーバスペックや、セキュリティルールについては今回の要件にあわせてください

**スペック**

*   CPU : 2 cores
    
*   Memory : 8GiB RAM
    
*   Storage: 50GB
    
*   OS : Ubuntu version 18.04 (Bionic Beaver)より最新版
    

**セキュリティルール**

*   8080 : HTTP
    
*   9000 : Sui-JSON-RPC (必要あれば)
    
*   9184 : Metircs (必要あれば)
    

**サーバの建て方**

[https://mirror.xyz/0xFA72ba6a332B196fC62bC221E4D32Cd166D0a9aF/E\_ZiVVBxade1BvikPXUxs-NyB46rSgQ3ixpykjFJlj4](https://mirror.xyz/0xFA72ba6a332B196fC62bC221E4D32Cd166D0a9aF/E_ZiVVBxade1BvikPXUxs-NyB46rSgQ3ixpykjFJlj4)

[https://mirror.xyz/0xFA72ba6a332B196fC62bC221E4D32Cd166D0a9aF/-V7iK5fG5b2qUK3GWrxAg7h8FCb7tcBysL6KzkWFVkE](https://mirror.xyz/0xFA72ba6a332B196fC62bC221E4D32Cd166D0a9aF/-V7iK5fG5b2qUK3GWrxAg7h8FCb7tcBysL6KzkWFVkE)

### 2-2. Githubアカウントの準備

ノードを建てるためにGithubアカウントが必要になります。 Githubにアクセスして、作成してください。

> 厳密に言いますと、Githubアカウントがなくてもノードを建てることが可能です。 しかし、Suiの公式手順ではGithubアカウントからのFork手順が推奨されています。
> 
> FullNodeの構築は、テストネット参加のための条件にもなっているため、 Githubアカウントでの確認を実施される可能性もあるため作成することを推奨します

[https://github.com/](https://github.com/)

### 2-3. Mystenlabs/suiレポジトリのFork

Mystenlabs/suiレポジトリにアクセス

[https://github.com/MystenLabs/sui](https://github.com/MystenLabs/sui)

右上のForkをクリック

![](https://storage.googleapis.com/papyrus_images/220258f89b9e70472f670ca6ae9a967efa9177461fe79e88f420f7b5528ab19f.png)

ForkしたRepositoryのURLをコピー インストールの際に使用するため、メモしておいてください

![](https://storage.googleapis.com/papyrus_images/167d3f26149db2592b69184e9446ef22aacfd86bf450fe4b03ed6bc6e848320f.png)

### 2-4. Install方法

**2-4-1. サーバにログインする**

[https://mirror.xyz/0xFA72ba6a332B196fC62bC221E4D32Cd166D0a9aF/83-FPa7t3SmuToOEV4iZsImzkK2AQPbcc5SrCjWZpY8](https://mirror.xyz/0xFA72ba6a332B196fC62bC221E4D32Cd166D0a9aF/83-FPa7t3SmuToOEV4iZsImzkK2AQPbcc5SrCjWZpY8)

**2-4-2. Rootユーザ (特権ユーザ)になる**

    sudo su -
    cd $HOME
    

**2-4-3. installerをダウンロード & 実行**

    wget -O install-sui-fullnode.sh https://raw.githubusercontent.com/qyeah98/sui-installer/main/install-sui-fullnode.sh
    

![](https://storage.googleapis.com/papyrus_images/0f2b69bcd65909bf942b45b64ef228c9d5411741d4fa73a8aa236786add2741b.png)

    chmod +x install-sui-fullnode.sh
    ./install-sui-fullnode.sh
    

![](https://storage.googleapis.com/papyrus_images/f2492e583e3d796f58a3894bab457d3c761838574bb0b5e56c8a522fb4eba8cc.png)

GithubのURL入力を求められるため、 先ほどCopyしたものを貼り付けてEnterを押してください

    INPUT your github url: 
    
    # 例
    INPUT your github url: https://github.com/qyeah98/sui.git
    

![](https://storage.googleapis.com/papyrus_images/d0fe3c2563381610d7902d6f2e7a8286e5d9b4db86dfa25105eaf468cadb6eb9.png)

Sui-JSON-RPC-APIを公開するか確認されます 外部からのAPIを許可したい場合には、`y`を入力してください 許可したくない場合には、`n`を入力してください

![](https://storage.googleapis.com/papyrus_images/ca3e1c6f110b2f34407011e38ad64476c30b1401e92ebacb4ca9b21f7fa3f204.png)

Sui Metrics Portを公開するか確認されます 外部からのMetricsを取得したい場合には、`y`を入力してください 許可したくない場合には、`n`を入力してください

![](https://storage.googleapis.com/papyrus_images/287220d9f0de53a52b1f0d63d4937f706766cd4577dd0dde826fba741cc41fb9.png)

インストールが始まります インストールが完了するまで、10分程度かかりますのでお待ちください

![](https://storage.googleapis.com/papyrus_images/e5c33cc71a987f93c773d6855569ca5c6abcdf40e2cda132412e1aa7e5140213.png)

下記のような結果が出れば完了です

![](https://storage.googleapis.com/papyrus_images/bd0af0e78068ccc977ad2c7abcbb5270f26ef9e58a7b7f02b872676a65644fcf.png)

`sui node started !`と表示されていればインストール正常に完了です これにて作業終了です サーバに接続しているターミナルはそのまま閉じてOKです

![](https://storage.googleapis.com/papyrus_images/c4ed8509584a226407f62dc6bfed8636ba0badd2371b120d42641a40c405199f.png)

### 2-5. Tips

**Nodeのログの表示　※ Ctrl c同時押しで停止します**

    journalctl -u suid -f -o cat
    

**Nodeの停止方法**

    sudo systemctl stop suid
    

**Nodeの再起動方法**

**Nodeの削除**

    sudo systemctl stop
    suid sudo systemctl disable
    suid rm -rf ~/sui /var/sui/
    rm /etc/systemd/suid.service 
    

**Nodeのアップデート**

    # Stop sui-node
    sudo systemctl stop suid
    
    # Remove old db
    rm -rf /var/sui/db /var/sui/genesis.blob
    
    # Fetch the source from the latest release
    git checkout -B devnet --track upstream/devnet
    
    # Reset your branch:
    git fetch upstream
    
    # Download latest genesis.blob
    wget -O /var/sui/genesis.blob https://github.com/MystenLabs/sui-genesis/raw/main/devnet/genesis.blob
    
    # Restart your Sui fullnode
    cargo build --release -p sui-node
    mv ~/sui/target/release/sui-node /usr/local/bin/
    
    sudo systemctl restart systemd-journald
    sudo systemctl daemon-reload
    sudo systemctl enable suid
    sudo systemctl restart suid
    

以上となります。 ぜひSuiのFullNodeを建てて、テストネットに参加していきましょう！

---

*Originally published on [qyeah](https://paragraph.com/@qyeah/sui-fullnode)*
