# 运行全节点

<mark style="background-color:green;">欢迎加入 MoveMove 社区</mark>：<https://discord.com/invite/sUmS7pm2q2>

### 推荐系统及配置

{% hint style="info" %}

* 测试网验证者节点推荐配置：8 核，32 GB RAM，128 GB 存储。

* 以下配置是官方推荐的全节点，实际已经不够，会导致全节点频繁异常退出，建议 4C 16GB 以上。
  {% endhint %}

* 系统：Ubuntu 20.04

* CPUs: 2 核

* RAM: 8 GB

* 存储: 50 GB

### 安装 Docker 和 docker-compose（Install Docker and docker-compose）

```shell
# Install Docker
sudo wget -O get-docker.sh https://get.docker.com 
sudo sh get-docker.sh
rm -f get-docker.sh

# Install docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

```

检查 Docker 和 docker-compose 是否安装：

```shell
sudo docker -v
sudo docker-compose -v
```

### 创建目录（Create Directory）

```bash
sudo mkdir -p ~/sui-node/devnet && cd ~/sui-node/devnet

```

### 下载编排文件及 genesis（Download files）

```bash
sudo wget -O fullnode-template.yaml https://github.com/MystenLabs/sui/raw/main/crates/sui-config/data/fullnode-template.yaml
sudo wget -O genesis.blob https://github.com/MystenLabs/sui-genesis/raw/main/devnet/genesis.blob
sudo wget -O docker-compose.yaml https://raw.githubusercontent.com/MystenLabs/sui/main/docker/fullnode/docker-compose.yaml

```

修改节点程序监听地址：

```shell
sudo sed -i 's/127.0.0.1:9184/0.0.0.0:9184/' fullnode-template.yaml
sudo sed -i 's/127.0.0.1:9000/0.0.0.0:9000/' fullnode-template.yaml

```

### 启动节点（Run node）

```bash
sudo docker-compose pull
sudo docker-compose up -d

```

{% hint style="warning" %}
如果您的节点端口不通，请关闭服务器防火墙，并在云服务器提供商的安全策略中放行如下端口：

全节点：

* 9000：full node REST API 端口；
* 9184：full node 指标端口；
  {% endhint %}

### 检查节点

{% hint style="info" %}
确保节点是运行中，否则执行下面的命令会出错！
{% endhint %}

#### 获取最近五次交易

```shell
curl --location --request POST 'http://127.0.0.1:9000/' \
    --header 'Content-Type: application/json' \
    --data-raw '{ "jsonrpc":"2.0", "id":1, "method":"sui_getRecentTransactions", "params":[5] }'

```

社区提供的检查节点状态网址：

* <https://node.sui.zvalid.com/>

### 节点更新

{% hint style="info" %}
本节仅用于节点更新使用！！！
{% endhint %}

#### 关闭节点

执行如下命令：

```shell
# 进入之前创建的 sui-node 目录，之后的操作都会在该目录下进行
cd ~/sui-node/devnet
# 关闭节点并删除数据卷
sudo docker-compose down -v

```

#### 删除 `genesis.blob` 文件并重新下载

执行如下命令即可下载并覆盖原文件：

```shell
# 下载 创世节点文件
sudo wget -O ./genesis.blob https://github.com/MystenLabs/sui-genesis/raw/main/devnet/genesis.blob

```

#### 更新节点镜像

运行如下命令：

```shell
sudo docker-compose pull

```

#### 启动全节点

在上面的命令行界面中运行如下命令：

```shell
sudo docker-compose up -d

```

:smile: 有疑问和建议可加入 MoveMove 社区：<https://discord.com/invite/sUmS7pm2q2>


---

# Agent Instructions: 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://wiki.sui.movemove.org/jiao-cheng/kai-fa-wang/yun-xing-quan-jie-dian.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.
