這篇“Neo私鏈怎么部署”文章的知識(shí)點(diǎn)大部分人都不太理解,所以小編給大家總結(jié)了以下內(nèi)容,內(nèi)容詳細(xì),步驟清晰,具有一定的借鑒價(jià)值,希望大家閱讀完這篇文章能有所收獲,下面我們一起來看看這篇“Neo私鏈怎么部署”文章吧。
創(chuàng)新互聯(lián)專注于企業(yè)營銷型網(wǎng)站、網(wǎng)站重做改版、大洼網(wǎng)站定制設(shè)計(jì)、自適應(yīng)品牌網(wǎng)站建設(shè)、H5開發(fā)、商城網(wǎng)站定制開發(fā)、集團(tuán)公司官網(wǎng)建設(shè)、成都外貿(mào)網(wǎng)站建設(shè)、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁設(shè)計(jì)等建站業(yè)務(wù),價(jià)格優(yōu)惠性價(jià)比高,為大洼等各大城市提供網(wǎng)站開發(fā)制作服務(wù)。
NEO 私有鏈的部署至少需要 4 臺(tái)服務(wù)器才能取得共識(shí),每臺(tái)服務(wù)器對(duì)應(yīng)一個(gè)共識(shí)節(jié)點(diǎn)。在阿里云上可以買按量付費(fèi)的虛擬機(jī)(機(jī)器都是window server)。
記錄下四臺(tái)機(jī)器的內(nèi)網(wǎng)IP地址,后面要用。
172.xxx.xxx.142
如果你想讓外部程序訪問該節(jié)點(diǎn)的 API 需要開放防火墻端口:10331-10334, 20331-20334
阿里云的vpc如果在一個(gè)安全組內(nèi)就不需要設(shè)置。也可以通過安全組開放所有入口。
阿里云安全組
運(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) ,否則后面無法啟動(dòng)Neo-CLI。
在四臺(tái)機(jī)器上分別創(chuàng)建錢包數(shù)據(jù)庫,數(shù)據(jù)庫文件會(huì)默認(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
記錄下另外幾臺(tái)機(jī)器的錢包公鑰
neo2
address: AY35ZjJayg9JfmCeHg1nySN4LSMntFEq2h pubkey: 035022ce81faca930ebe6b9f8e830526150e47692f19f58affe1311e42cd0d43bb
neo3
address: AQZNtdGVXbfot5fSaR4ijBqrEwbnFQspmH pubkey: 029f21d56f9422e55f0ef7cf75c092854e01c99aeee73f0effeaa489a96fc7d2b1
neo4
address: AXctyT8ctWTXtWaUFM9o5FJas8BWdBbiqe pubkey: 02dc0e750e21c386537618079d89836eea39fad396206e2e56cfba16bdc014dc5d
{ "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,請(qǐng)刪除chain目錄下的文件,這樣區(qū)塊鏈高度會(huì)從1開始。
截取其中一個(gè)打印,后面方便調(diào)試的時(shí)候研究
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)容對(duì)大家有幫助,若想了解更多相關(guān)的知識(shí)內(nèi)容,請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。