昨天 Dawn2.0 發佈了公共的測試網絡,本文介紹一下如何在本地運行一個節點,鏈接到公共測試節點,註冊賬戶進行測試。github 教程,筆者系統配置,ubuntu16.04,RAM4G,
-
使用安裝腳本安裝本地節點,
-
git clone [url=https://github.com/eosio/eos]https://github.com/eosio/eos[/url] –recursive
-
cd eos
-
./build.sh ubuntu
複製代碼
-
使用腳本運行本地節點連接到公共測試節點
-
cd ~/eos/build/scripts
-
./start_npnode.sh
複製代碼
這個命令將使用名稱爲 testnet_np 的實例數據文件夾。
你應該會看到以下的迴應:
-
Launched eosd.
-
See testnet_np/stderr.txt for eosd output.
-
Synching requires at least 8 minutes, depending on network conditions.
複製代碼
使用以下命令來確認 eosd 的運行和同步:
- tail -F testnet_np/stderr.txt
複製代碼
使用 CTRL-C 來推出 tail,在同步的過程中,你會看到以下類似的信息:
-
3439731 ms chain_plugin.cpp:272 accept_block ] Syncing Blockchain — Got block: #200000 time: 2017-12-09T07:56:32 producer: initu
-
3454532 ms chain_plugin.cpp:272 accept_block ] Syncing Blockchain — Got block: #210000 time: 2017-12-09T13:29:52 producer: initc
複製代碼
同步完成後,你會看到以下類似信息:
-
42467 ms net_plugin.cpp:1245 start_sync ] Catching up with chain, our last req is 351734, theirs is 351962 peer ip-10-160-11-116:9876
-
42792 ms chain_controller.cpp:208 _push_block ] initt #351947 @2017-12-12T22:59:44 | 0 trx, 0 pending, exectime_ms=0
-
42793 ms chain_controller.cpp:208 _push_block ] inito #351948 @2017-12-12T22:59:46 | 0 trx, 0 pending, exectime_ms=0
-
42793 ms chain_controller.cpp:208 _push_block ] initd #351949 @2017-12-12T22:59:48 | 0 trx, 0 pending, exectime_ms=0
複製代碼
-
創建錢包,密鑰對,申請賬號。
-
cd eosc
-
./eosc wallet create#創建錢包,記得保持私鑰,丟失後將無法解鎖你的錢包。
複製代碼
-
./eosc create key
-
Private key: 5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #你的私鑰
-
Public key: EOSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #你的公鑰
複製代碼
- ./eosc wallet import 5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx #導入你的私鑰
複製代碼
現在公共測試網絡需要申請來註冊賬戶,申請地址,按照文檔步驟填寫表格,大概在半個小時我收到了郵件回覆。
這個時候查看我的賬戶,裏面有 100EOS 代幣了。
-
./eosc get account name55
-
{
-
\”account_name\”: \”name55\”,
-
\”eos_balance\”: \”100.0000 EOS\”,
-
\”staked_balance\”: \”0.0001 EOS\”,
-
\”unstaking_balance\”: \”0.0000 EOS\”,
-
\”last_unstaking_time\”: \”1969-12-31T23:59:59\”,
-
\”permissions\”: [{
-
\”perm_name\”: \”active\”,
-
\”parent\”: \”owner\”,
-
\”required_auth\”: {
-
\”threshold\”: 1,
-
\”keys\”: [{
-
\”key\”: \”EOS6 m4QMe38FkRTgChhE9oPHMPKC5MZDsf2NYSCAG7Y9F7ez6n9V5\”,
-
\”weight\”: 1
-
}
-
],
-
\”accounts\”: []
-
}
-
},{
-
\”perm_name\”: \”owner\”,
-
\”parent\”: \”\”,
-
\”required_auth\”: {
-
\”threshold\”: 1,
-
\”keys\”: [{
-
\”key\”: \”EOS6 m4QMe38FkRTgChhE9oPHMPKC5MZDsf2NYSCAG7Y9F7ez6n9V5\”,
-
\”weight\”: 1
-
}
-
],
-
\”accounts\”: []
-
}
-
}
-
]
-
}
複製代碼
這樣就可以使用公共測試網絡來進行測試,和 DAPP 的開發部署了。
來源鏈接:None