# 使用脚本设置Masternode

本指南适用于在Ubuntu 16.04 / 18.04 64位服务器（VPS）上设置FIX masternode，并将通过本地电脑上的钱包（**本地钱包**）进行控制， VPS上的钱包将被称为**远程钱包**。

## **要求：**  <a href="#yao-qiu" id="yao-qiu"></a>

1. 1,000,000 FIX
2. 主电脑（你的个人电脑）- 这将运行**本地钱包**，保持抵押品1,000,000 FIX，可以打开和关闭，且不会影响masternode。
3. &#x20;Ubuntu 16.04 / 18.04Masternode服务器用来运行masternode（VPS - 24小时/7天全天候运行**远程钱包**的服务器）
4. 使用脚本设置单个FIX masternode

## **本地钱包安装：** <a href="#ben-di-qian-bao-an-zhuang" id="ben-di-qian-bao-an-zhuang"></a>

1. 在本地计算机上下载，安装和同步FIX钱包，这在本指南中称为**本地钱包**，可在[此处](https://github.com/NewCapital/FIX-Core/releases)找到电子钱包链接。
2. 现在在本地钱包中，进入调试控制台，进入（工具>调试控制台）并键入以下命令：**`masternode genkey`**

   此命令将生成你的Masternode私钥，保存此私钥，我们稍后会使用它。

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LYvndWBvrmJxi5m4Vyp%2F-LiC-dNU8XkhpI3bOVhG%2F-LiC-x6xLPYothhDeQhH%2Fmn1w.PNG?alt=media\&token=27c5b0cd-7070-43b7-acc1-914107f5c02d)

* 3\. 在本地钱包中，在调试控制台上输入以下命令：这将为你的masternode创建一个钱包地址和masternode别名，保存这个，因为我们稍后会用到它。**`getaccountaddress mn1`**

  ​
* 4\. 将1,000,000个FIX发送到上一步中生成的地址，在“总计”栏位

  输入“1,000,000”，如果你输入更多或少于1,000,000，或尝试将付款拆分为两个交易，你将无法继续下一步；当你按下发送按钮时，钱包将计算正确的交易费用，在随后出现的对话框中单击“是”，然后继续执行下一步。**100％确保这是正确数量，如果你将1,000,000 FIX发送到错误的地址，我们将无法帮助你。**
* 5\. 使用本地钱包，等待16个确认，然后进入调试控制台（工具栏：工具>调试控制台）并输入以下命令；这将显示TX ID及Index索引，将其保存到记事本。（这是发送1,000,000 FIX的交易证明） `masternode output`

  ​
* 6\. 在本地钱包的工具栏中，单击 工具 > 打开Masternode配置文件以打开masternode.conf并添加以下信息：`Masternode 別名(使用你在步骤3输入的名称)>:17464 <步骤2输出的信息> <步骤5输出的信息> <步骤5最后面的数字>`

&#x20;保存文件并**重新启动钱包**

* ```
  按上述格式示例：
  mn1 67.156.12.34:17464 8x3zaQA9beRtGaatxfcWbyWRxQNgS3LmwhFzqzKTVK3cZafWGd9 edeeb2bb91286725b62d74a574370c07a7c8717e9af859999c596f485ee048ae 1
  ```

  示例masternode.conf文件

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LYvndWBvrmJxi5m4Vyp%2F-LiC-dNU8XkhpI3bOVhG%2F-LiC2GXIYuZtZxjJiRCb%2Fmn3w.PNG?alt=media\&token=6d3ceac3-ad33-4a80-95c0-3162b87d4a71)

## &#x20;**VPS远程钱包安装**  <a href="#vps-yuan-cheng-qian-bao-an-zhuang" id="vps-yuan-cheng-qian-bao-an-zhuang"></a>

首先安装钱包，使用SSH客户端登录VPS。登录后，在VPS终端中输入以下命令。

1. 下载MN安装脚本

```
wget https://github.com/NewCapital/FIX-Core/releases/download/fix_v3.3.8.1/fix-mninstall.sh
```

2\. 运行MN安装脚本

```
bash fix-mninstall.sh
```

3\. 按照说明操作&#x20;

&#x20;        **启动你的Masternode**&#x20;

&#x20;        右键单击你的masternode并选择“Start alias”

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LYvndWBvrmJxi5m4Vyp%2F-LiC-dNU8XkhpI3bOVhG%2F-LiC2xOVCRELS_R8xQUt%2Fmn5.png?alt=media\&token=c4bc4ae8-5ec1-437f-9ba0-a7cb1b69f8ed)

## 如何确认你的Masternode正在运行 <a href="#ru-he-que-ren-ni-de-masternode-zheng-zai-yun-hang" id="ru-he-que-ren-ni-de-masternode-zheng-zai-yun-hang"></a>

回到VPS（远程钱包），通过以下方式启动masternode： `./fix-cli startmasternode local false`

应该出现消息“masternode successfully started” `./fix-cli masternode status`

你应该看到类似的信息

```
{
  "txhash": "edeeb2bb91286725b62d74a574370c07a7c8717e9af859999c596f485ee048ae",
  "outputidx": 1,
  "netaddr": "67.156.12.34:17464",
  "addr": "FB1NnSssudT8rPSvnHWeTR7v5qstmxeVNC",
  "status": 4,
  "message": "Masternode successfully started"
}
```

**在钱包中启动masternode后，**&#x4F60;**也可以在区块浏览器检查masternode。**

要执行此操作，请使用鼠标（在上面的示例中）从终端窗口复制你的masternode钱包地址(上面的释例`FB1NnSssudT8rPSvnHWeTR7v5qstmxeVNC`)，访问FIX区块浏览器的 masternode部分，在masternodes列表搜索你的masternode地址。

你的masternode状态应显示为“ACTIVE”。

{% hint style="info" %}
启动masternode后，其状态将按以下顺序更改：

"ACTIVE" --> 启动后约2-3小时

"EXPIRED" --> 只需几分钟

"REMOVE" --> 只需几分钟

"ENABLED" --> 最终masternode将保持此状态， "Active" 时间将开始增加

注意：若你的本地钱包中的masternode状态为“MISSING”，请检查其在[区块浏览器](https://explorer.fix.network/masternodes)中masternode的状态，它可能是EXPIRED / REMOVE。
{% endhint %}

{% hint style="danger" %}
不要着急！收到第一次masternode奖励后，之后再次获得奖励的时间要花**2倍到3倍**。如果从钱包再次启动masternode，此计时器将重置为零。
{% endhint %}

&#x20;恭喜！你已成功创建了masternode。 ​


---

# 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.fix.network/zhong-wen/fix-masternodes/shi-yong-jiao-ben-she-zhi-masternode.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.
