溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Neo私鏈怎么部署

發(fā)布時間:2022-01-11 15:55:57 來源:億速云 閱讀:149 作者:iii 欄目:互聯(lián)網(wǎng)科技

這篇“Neo私鏈怎么部署”文章的知識點(diǎn)大部分人都不太理解,所以小編給大家總結(jié)了以下內(nèi)容,內(nèi)容詳細(xì),步驟清晰,具有一定的借鑒價值,希望大家閱讀完這篇文章能有所收獲,下面我們一起來看看這篇“Neo私鏈怎么部署”文章吧。

配置虛擬機(jī)

NEO 私有鏈的部署至少需要 4 臺服務(wù)器才能取得共識,每臺服務(wù)器對應(yīng)一個共識節(jié)點(diǎn)。在阿里云上可以買按量付費(fèi)的虛擬機(jī)(機(jī)器都是window server)。
記錄下四臺機(jī)器的內(nèi)網(wǎng)IP地址,后面要用。

172.xxx.xxx.142

端口

如果你想讓外部程序訪問該節(jié)點(diǎn)的 API 需要開放防火墻端口:10331-10334, 20331-20334
阿里云的vpc如果在一個安全組內(nèi)就不需要設(shè)置。也可以通過安全組開放所有入口。

Neo私鏈怎么部署

阿里云安全組

安裝運(yùn)行時

  • 運(yùn)行環(huán)境

運(yùn)行 NEO 節(jié)點(diǎn)需要安裝 .NET Core Runtime,需要安裝 1.0.1 或以上版本

  • Windows 系統(tǒng)下的安裝方法

在 Windows 系統(tǒng)下安裝 .NET Core 非常方便,直接下載運(yùn)行即可。

NOTE

Windows可能還需要安裝Microsoft Visual C++ 2015 Redistributable Update 3(https://www.microsoft.com/en-us/download/details.aspx?id=53840) ,否則后面無法啟動Neo-CLI。

創(chuàng)建錢包

在四臺機(jī)器上分別創(chuàng)建錢包數(shù)據(jù)庫,數(shù)據(jù)庫文件會默認(rèn)生成在neo-cli的目錄下面

 create wallet wallet.json
  • db3后綴名的數(shù)據(jù)庫文件不支持了

neo1

neo> create wallet wallet.db3
Wallet files in db3 format are not supported, please use a .json file extension.
neo> create wallet wallet.json
password: ********
password: ********
address: AS43TUy7VtuGpNJh3YC2NM3asTv3s6piyk
 pubkey: 02d57c9bbc42b45943867dff0180cb9df266b46db7d027a283eabc7c4b8819c86c

記錄下另外幾臺機(jī)器的錢包公鑰
neo2

address: AY35ZjJayg9JfmCeHg1nySN4LSMntFEq2h
 pubkey: 035022ce81faca930ebe6b9f8e830526150e47692f19f58affe1311e42cd0d43bb

neo3

address: AQZNtdGVXbfot5fSaR4ijBqrEwbnFQspmH
 pubkey: 029f21d56f9422e55f0ef7cf75c092854e01c99aeee73f0effeaa489a96fc7d2b1

neo4

address: AXctyT8ctWTXtWaUFM9o5FJas8BWdBbiqe
 pubkey: 02dc0e750e21c386537618079d89836eea39fad396206e2e56cfba16bdc014dc5d

修改節(jié)點(diǎn)的配置文件

{
  "ProtocolConfiguration": {
    "Magic": 1,
    "AddressVersion": 23,
    "StandbyValidators": [
      "02d57c9bbc42b45943867dff0180cb9df266b46db7d027a283eabc7c4b8819c86c",
      "035022ce81faca930ebe6b9f8e830526150e47692f19f58affe1311e42cd0d43bb",
      "029f21d56f9422e55f0ef7cf75c092854e01c99aeee73f0effeaa489a96fc7d2b1",
      "02dc0e750e21c386537618079d89836eea39fad396206e2e56cfba16bdc014dc5d"
    ],
    "SeedList": [
      "172.24.198.142:10333",
      "172.24.198.141:10333",
      "172.24.198.140:10333",
      "172.24.198.139:10333"
    ],
    "SystemFee": {
      "EnrollmentTransaction": 0,
      "IssueTransaction": 0,
      "PublishTransaction": 0,
      "RegisterTransaction": 0
    }
  }
}

打開錢包,開啟共識

open wallet wallet.json
start consensus

如果前面打開過cli,請刪除chain目錄下的文件,這樣區(qū)塊鏈高度會從1開始。

  • 截取其中一個打印,后面方便調(diào)試的時候研究

neo> open wallet wallet.json
password: ********
neo> start consensus
[18:04:31] OnStart
[18:04:31] initialize: height=1 view=0 index=0 role=Backup
[18:04:47] OnChangeViewReceived: height=1 view=0 index=2 nv=2
[18:05:01] timeout: height=1 view=0 state=Backup
[18:05:01] request change view: height=1 view=0 nv=1 state=Backup, ViewChanging
[18:05:58] OnPrepareRequestReceived: height=1 view=0 index=1 tx=1
[18:05:58] send perpare response
[18:06:01] OnPrepareResponseReceived: height=1 view=0 index=2
[18:06:01] relay block: 0x8515184285fa2e454b0eca441580b5cce01cc0e5cb5dd6d7ff53ef13ec7f665e
[18:06:01] persist block: 0x8515184285fa2e454b0eca441580b5cce01cc0e5cb5dd6d7ff53ef13ec7f665e
[18:06:01] initialize: height=2 view=0 index=0 role=Backup
[18:06:16] OnPrepareRequestReceived: height=2 view=0 index=2 tx=1
[18:06:16] send perpare response
[18:06:19] OnPrepareResponseReceived: height=2 view=0 index=1
[18:06:19] relay block: 0x35b163f4f524a1ebcc1ef3053e878f9bb37b1f4a8531a060ef18cfd6efefdf45
[18:06:19] persist block: 0x35b163f4f524a1ebcc1ef3053e878f9bb37b1f4a8531a060ef18cfd6efefdf45
[18:06:19] initialize: height=3 view=0 index=0 role=Backup
[18:06:49] timeout: height=3 view=0 state=Backup
[18:06:49] request change view: height=3 view=0 nv=1 state=Backup, ViewChanging
[18:06:49] OnChangeViewReceived: height=3 view=0 index=1 nv=1
[18:06:53] OnChangeViewReceived: height=3 view=0 index=2 nv=1
[18:06:53] initialize: height=3 view=1 index=0 role=Backup
[18:06:55] OnPrepareRequestReceived: height=3 view=1 index=2 tx=1
[18:06:55] send perpare response
[18:06:55] OnPrepareResponseReceived: height=3 view=1 index=1
[18:06:55] relay block: 0x1766a0602903f513f76561c93fddf312f70d30801310abfecacc89feace5c412
[18:06:55] persist block: 0x1766a0602903f513f76561c93fddf312f70d30801310abfecacc89feace5c412
[18:06:55] initialize: height=4 view=0 index=0 role=Primary
[18:07:10] timeout: height=4 view=0 state=Primary
[18:07:10] send perpare request: height=4 view=0
[18:07:13] OnPrepareResponseReceived: height=4 view=0 index=3
[18:07:13] OnPrepareResponseReceived: height=4 view=0 index=2
[18:07:13] relay block: 0x5233d9086db97e59f86d73e8735093c1b3fe4569759697ff8a04e0eb8f389091
[18:07:13] persist block: 0x5233d9086db97e59f86d73e8735093c1b3fe4569759697ff8a04e0eb8f389091
[18:07:13] initialize: height=5 view=0 index=0 role=Backup

以上就是關(guān)于“Neo私鏈怎么部署”這篇文章的內(nèi)容,相信大家都有了一定的了解,希望小編分享的內(nèi)容對大家有幫助,若想了解更多相關(guān)的知識內(nèi)容,請關(guān)注億速云行業(yè)資訊頻道。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

neo
AI