昨天 Dawn2.0 發佈了公共的測試網絡,本文介紹一下如何在本地運行一個節點,鏈接到公共測試節點,註冊賬戶進行測試。github 教程,筆者系統配置,ubuntu16.04,RAM4G,

  1. 使用安裝腳本安裝本地節點,

  2. git clone [url=https://github.com/eosio/eos]https://github.com/eosio/eos[/url] –recursive

  3. cd eos

  4. ./build.sh ubuntu

複製代碼

  1. 使用腳本運行本地節點連接到公共測試節點

  2. cd ~/eos/build/scripts

  3. ./start_npnode.sh

複製代碼

這個命令將使用名稱爲 testnet_np 的實例數據文件夾。

你應該會看到以下的迴應:

  1. Launched eosd.

  2. See testnet_np/stderr.txt for eosd output.

  3. Synching requires at least 8 minutes, depending on network conditions.

複製代碼

使用以下命令來確認 eosd 的運行和同步:

  1. tail -F testnet_np/stderr.txt

複製代碼

使用 CTRL-C 來推出 tail,在同步的過程中,你會看到以下類似的信息:

  1. 3439731 ms chain_plugin.cpp:272 accept_block ] Syncing Blockchain — Got block: #200000 time: 2017-12-09T07:56:32 producer: initu

  2. 3454532 ms chain_plugin.cpp:272 accept_block ] Syncing Blockchain — Got block: #210000 time: 2017-12-09T13:29:52 producer: initc

複製代碼

同步完成後,你會看到以下類似信息:

  1. 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

  2. 42792 ms chain_controller.cpp:208 _push_block ] initt #351947 @2017-12-12T22:59:44 | 0 trx, 0 pending, exectime_ms=0

  3. 42793 ms chain_controller.cpp:208 _push_block ] inito #351948 @2017-12-12T22:59:46 | 0 trx, 0 pending, exectime_ms=0

  4. 42793 ms chain_controller.cpp:208 _push_block ] initd #351949 @2017-12-12T22:59:48 | 0 trx, 0 pending, exectime_ms=0

複製代碼

  1. 創建錢包,密鑰對,申請賬號。

  2. cd eosc

  3. ./eosc wallet create#創建錢包,記得保持私鑰,丟失後將無法解鎖你的錢包。

複製代碼

  1. ./eosc create key

  2. Private key: 5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #你的私鑰

  3. Public key: EOSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #你的公鑰

複製代碼

  1. ./eosc wallet import 5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx #導入你的私鑰

複製代碼

現在公共測試網絡需要申請來註冊賬戶,申請地址,按照文檔步驟填寫表格,大概在半個小時我收到了郵件回覆。

這個時候查看我的賬戶,裏面有 100EOS 代幣了。

  1. ./eosc get account name55

  2. {

  3. \”account_name\”: \”name55\”,

  4. \”eos_balance\”: \”100.0000 EOS\”,

  5. \”staked_balance\”: \”0.0001 EOS\”,

  6. \”unstaking_balance\”: \”0.0000 EOS\”,

  7. \”last_unstaking_time\”: \”1969-12-31T23:59:59\”,

  8. \”permissions\”: [{

  9. \”perm_name\”: \”active\”,

  10. \”parent\”: \”owner\”,

  11. \”required_auth\”: {

  12. \”threshold\”: 1,

  13. \”keys\”: [{

  14. \”key\”: \”EOS6 m4QMe38FkRTgChhE9oPHMPKC5MZDsf2NYSCAG7Y9F7ez6n9V5\”,

  15. \”weight\”: 1

  16. }

  17. ],

  18. \”accounts\”: []

  19. }

  20. },{

  21. \”perm_name\”: \”owner\”,

  22. \”parent\”: \”\”,

  23. \”required_auth\”: {

  24. \”threshold\”: 1,

  25. \”keys\”: [{

  26. \”key\”: \”EOS6 m4QMe38FkRTgChhE9oPHMPKC5MZDsf2NYSCAG7Y9F7ez6n9V5\”,

  27. \”weight\”: 1

  28. }

  29. ],

  30. \”accounts\”: []

  31. }

  32. }

  33. ]

  34. }

複製代碼

這樣就可以使用公共測試網絡來進行測試,和 DAPP 的開發部署了。

來源鏈接:None