# 全节点搭建

{% hint style="warning" %}

1. 建议在新的服务器上运行，本教程也是以新的服务器为例。
2. 搭建全节点要使用到验证者节点的文件，请确保在搭建验证者节点时，填写了正确的全节点 IP 或域名。
   {% endhint %}

### 创建全节点目录

{% code overflow="wrap" %}

```bash
# 切换到 root 用户
sudo su

# 创建全节点目录
mkdir -p /root/aptos-node/movemove/testnet3/keys
cd /root/aptos-node/movemove/testnet3

```

{% endcode %}

### 下载全节点配置文件和编排文件

{% code overflow="wrap" lineNumbers="true" %}

```bash
sudo wget -O docker-compose-fullnode.yaml https://raw.githubusercontent.com/jiangydev/aptos-node/main/testnet/AIT3/docker-compose-fullnode.yaml

sudo wget -O fullnode.yaml https://raw.githubusercontent.com/aptos-labs/aptos-core/main/docker/compose/aptos-node/fullnode.yaml

```

{% endcode %}

### 编辑全节点配置文件

文件：`fullnode.yaml`

修改第 17 行的内容为您的您的验证者节点ip或域名，其他的内容无需修改：

{% code lineNumbers="true" %}

```yaml
base:
  role: "full_node"
  data_dir: "/opt/aptos/data"
  waypoint:
    from_file: "/opt/aptos/genesis/waypoint.txt"

execution:
  genesis_file_location: "/opt/aptos/genesis/genesis.blob"

full_node_networks:
- network_id:
    private: "vfn"
  listen_address: "/ip4/0.0.0.0/tcp/6181"
  seeds:
    00000000000000000000000000000000d58bc7bb154b38039bc9096ce04e1237:
      addresses:
      - "/ip4/修改成您的验证者节点ip或域名/tcp/6181/noise-ik/f0274c2774519281a8332d0bb9d8101bd58bc7bb154b38039bc9096ce04e1237/handshake/0"
      role: "Validator"

- network_id: "public"
  discovery_method: "onchain"
  listen_address: "/ip4/0.0.0.0/tcp/6182"
  max_inbound_connections: 100
  identity:
    type: "from_file"
    path: "/opt/aptos/genesis/validator-full-node-identity.yaml"

api:
  enabled: true
  address: "0.0.0.0:8080"
```

{% endcode %}

### 拷贝 genesis.blob、waypoint.txt 和 fullnode key 文件

{% hint style="warning" %}
本步骤中的命令在验证者节点上执行！！！
{% endhint %}

{% code lineNumbers="true" %}

```bash
 # 进入验证者节点操作的目录（如果不是，请自行修改）
 cd /root/aptos-node/testnet3
 
 sudo scp genesis.blob root@全节点ip:/root/aptos-node/movemove/testnet3/
 
 sudo scp waypoint.txt root@全节点ip:/root/aptos-node/movemove/testnet3/
 
 sudo scp keys/validator-full-node-identity.yaml root@全节点ip:/root/aptos-node/movemove/testnet3/keys/
 
```

{% endcode %}

### 启动全节点

{% hint style="info" %}
需要放行的端口：80、9101、6182
{% endhint %}

```bash
sudo docker-compose -f docker-compose-fullnode.yaml pull

sudo docker-compose -f docker-compose-fullnode.yaml up -d
```

### 节点检测

```bash
sudo curl 127.0.0.1/v1
```

如果返回 error，或自行查看节点日志出现大量 401，则节点是有问题的，可以参考的解决方案：

1. 验证者节点未放行 6181 端口；
2. 未使用验证者节点的 genesis.blob、waypoint.txt 和 fullnode key 文件；
3. 验证者节点搭建过程中，未正确填写全节点 ip 和端口。

对教程有建议？欢迎加入 MoveMove 社区：<https://discord.gg/Vsj7Jwny9G>


---

# 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.aptos.movemove.org/jiao-cheng/ce-shi-wang-testnet/she-qu-jiao-cheng/quan-jie-dian-da-jian.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.
