# 在一台VPS上设置多个Masternode v2

此方法将使用NEO脚本： <https://github.com/neo3587/dupmn> **为何选择NEO剧本？**

* 可轻松使用于任何硬币或项目
* 可以使用IPv4或IPv6
* 它使用bootstrap来加速MN钱包与区块链的同步 -> 即时同步
* 可定制和持续维护

本教程将逐步向你演示如何通过NEO脚本在单个VPS服务器上设置多个TWINS Masternode。

**NEO脚本的使用概念**

* 像往常一样安装一个TWINS masternode，这个节点将是其他

  所有节点的参考节点。
* 安装NEO脚本
  * 创建TWINS特定使用的.dmn文件
  * 在.dmn添加相关信息
  * 使用命令“dupmn install twins \<params\_optional>”来安装任意数量的实例（masternode）

## 安装步骤 <a href="#installation-steps" id="installation-steps"></a>

1. **安装TWINS的参考节点**

我不花太多时间在这部分，因为这已经在其他文档中介绍过，你可以参考：<https://docs.win.win/twins/zhong-wen/twins-masternodes/shi-yong-an-zhuang-jiao-ben-she-zhi-masternode>​

比较重要的是你不需要让这个参考节点跟你的本地QT钱包对话，即masternode.conf文件中不需输入这个参考节点的任何条目（不需输入MN抵押品、Txid），你只需在需要时输入私钥即可。

因此这个参考节点的状态将始终为： `status : Not capable masternode: Hot node, waiting for remote activation.`

**2. 创建TWINS参考节点的实例**

**2.1 下载并安装NEO脚本**

```
curl -sL https://raw.githubusercontent.com/neo3587/dupmn/master/dupmn_install.sh | sudo -E bash  - 
```

**2.2 修改twins.dmn文件**

在根文件夹中输入：

**`nano twins.dmn`**，将以下内容粘贴到其中并使用ctrl + x保存文件

```
COIN_NAME="TWINS"             # 硬币的名称
COIN_PATH="/root/"            # 非必要参数，守护程序和cli的位置（仅当它们不在/usr/local/bin/ 或 /usr/bin/ 时才需要）
COIN_DAEMON="twinsd"          # 守护程序的名称
COIN_CLI="twins-cli"          # cli的名称
COIN_FOLDER="/root/.twins"    # 储存conf文件和区块链的文件夹位址
COIN_CONFIG="twins.conf"      # conf文件的名称
RPC_PORT=45454                # 非必要参数，若.conf文件中没有设置rpcport参数，将强制从特定的rpc端口开始查找，或主节点的rpc端口不在1024到49451之间（否则它会从1024开始查找）。
COIN_SERVICE="twins.service"  # 非必要参数，如果你想把节点设置成系统服务，请为systemctlall和bootstrap命令添加此参数。
```

**2.3 添加信息到dupmn以供使用**

输入命令：

**`dupmn profadd twins.dmn twins`**

如果你的命令成功，即如果你的twins.dmn是正确的，你应该得到这个输出：

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LYvndWBvrmJxi5m4Vyp%2F-Ln5_Bl4nqJRcFLj2hnr%2F-Ln5jYdEGiaD7VX3vpQ6%2Fv21.png?alt=media\&token=fe986e77-2859-49db-b022-9c56c1a2e8d8)

**2.4创建Masternode实例**

输入命令 **`dupmn install twins`**，你应该得到这个输出：

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LYvndWBvrmJxi5m4Vyp%2F-Ln5_Bl4nqJRcFLj2hnr%2F-Ln5k0jhHDM8QSLzStQi%2Fv22.png?alt=media\&token=4d1666b3-6701-4641-b9e9-dea35ccd24ae)

该输出显示许多诸如“twins-cli-x masternode status”，x是你的masternode实例，以验证masternode状态，它还会生成一个私钥，您可以添加到本地钱包的masternode.conf文件中，或使用--privkey参数强制执行私钥。

你还可以启用bootstrap以立即同步新MN，并与强制执行privkey结合使用：

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LYvndWBvrmJxi5m4Vyp%2F-Ln5kDDqEG_o7sjfpALm%2F-Ln5lmVzGf6yS6FyIEWu%2Fv23.png?alt=media\&token=e4a2ff6d-1226-4d51-b465-dfe00f7385df)

一旦你的本地QT钱包已正确设置（抵押品发送到MN地址、配置masternode.conf文件、启动别名等...）

你可以使用该命令检查MN的状态 **`twins-cli-all masternode status`**

"all"关键字将显示所有MN的摘要，你可以使用你的MN实例编号查看特定的MN。如你所见，主要实例名称是instance 0或MN0：

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LYvndWBvrmJxi5m4Vyp%2F-Ln5kDDqEG_o7sjfpALm%2F-Ln5mnoBe41UGtt828Zf%2Fv24.png?alt=media\&token=75506685-4def-4396-b855-9a221856b131)

有关更好定制dupmn的其他参数的详细信息，你可以查看neo的github页面（请参阅上面的链接）或运行命令 **`dupmn help`**，将显示可用的dupmn命令列表。

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LYvndWBvrmJxi5m4Vyp%2F-Ln5kDDqEG_o7sjfpALm%2F-Ln5n9T7IuteBFU50xkV%2Fv25.png?alt=media\&token=ad468e3e-c19a-4742-9e30-51c8fe3882c2)

就是这样，谢谢阅读。

如果你有疑问，随时到New Capital的Discord提问[https://discord.gg/CPEuShP​](https://discord.gg/eMkbGbe)

YouTube频道有相关视频教程，它是用于FIX Network硬币，但同样适用于TWINS：<https://www.youtube.com/watch?v=knkRv6_ZGO4>​


---

# 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://docs.win.win/twins/zhong-wen/twins-masternodes/zai-yi-tai-vps-shang-she-zhi-duo-ge-masternodev2.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.
