您好,登錄后才能下訂單哦!
Ubuntu中怎么搭建EOS測試環境,相信很多沒有經驗的人對此束手無策,為此本文總結了問題出現的原因和解決方法,通過這篇文章希望你能解決這個問題。
git clone https://github.com/EOSIO/eos --recursive
遇到的問題以及解決方案如下:
問題: 正克隆到 'test/emscripten'... remote: Counting objects: 109999, done. remote: Compressing objects: 100% (49/49), done. error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-properly terminated. fatal: The remote end hung up unexpectedly fatal: 過早的文件結束符(EOF) fatal: index-pack failed fatal: 無法克隆 'https://github.com/kripken/emscripten.git' 到子模組路徑 'test/emscripten' 無法遞歸進子模組路徑 'externals/binaryen' 解決方案: 造成無法克隆的原因是沒有賦予root權限,執行命令 cd eos sudo git submodule update --init --recursive 正確克隆結果: 正克隆到 'test/emscripten'... remote: Counting objects: 109999, done. remote: Compressing objects: 100% (49/49), done. remote: Total 109999 (delta 31), reused 35 (delta 19), pack-reused 109929 接收對象中: 100% (109999/109999), 159.40 MiB | 1.22 MiB/s, 完成. 處理 delta 中: 100% (76465/76465), 完成. 檢查連接... 完成。 子模組路徑 'externals/binaryen/test/emscripten':檢出 '1d979a75722a513b586e6705d662ff4ee0ea832b' 正克隆到 'test/spec'... remote: Counting objects: 989, done. remote: Total 989 (delta 0), reused 0 (delta 0), pack-reused 989 接收對象中: 100% (989/989), 605.07 KiB | 354.00 KiB/s, 完成. 處理 delta 中: 100% (663/663), 完成. 檢查連接... 完成。 子模組路徑 'externals/binaryen/test/spec':檢出 '668281b3d7dfe9be6cbc3c4500b537c49d6449b9' 正克隆到 'test/waterfall'... remote: Counting objects: 2738, done. remote: Compressing objects: 100% (3/3), done. remote: Total 2738 (delta 0), reused 1 (delta 0), pack-reused 2735 接收對象中: 100% (2738/2738), 680.70 KiB | 358.00 KiB/s, 完成. 處理 delta 中: 100% (1993/1993), 完成. 檢查連接... 完成。 子模組路徑 'externals/binaryen/test/waterfall':檢出 '900646fc880d526160b0df9b78bc9dd4f02dc1ab' 正克隆到 'externals/magic_get'... remote: Counting objects: 2499, done. remote: Total 2499 (delta 0), reused 0 (delta 0), pack-reused 2499 接收對象中: 100% (2499/2499), 532.04 KiB | 253.00 KiB/s, 完成. 處理 delta 中: 100% (1775/1775), 完成. 檢查連接... 完成。 子模組路徑 'externals/magic_get':檢出 '89fda1da702e6c76a22bfb6233e9e3d0641708ec' 正克隆到 'libraries/appbase'... remote: Counting objects: 240, done. remote: Compressing objects: 100% (3/3), done. remote: Total 240 (delta 0), reused 1 (delta 0), pack-reused 237 接收對象中: 100% (240/240), 62.12 KiB | 0 bytes/s, 完成. 處理 delta 中: 100% (112/112), 完成. 檢查連接... 完成。 子模組路徑 'libraries/appbase':檢出 '44d7d88e561cc9708bcac9453686c8d0f0ffa41e' 正克隆到 'libraries/chainbase'... remote: Counting objects: 325, done. remote: Compressing objects: 100% (7/7), done. remote: Total 325 (delta 2), reused 8 (delta 2), pack-reused 315 接收對象中: 100% (325/325), 68.23 KiB | 111.00 KiB/s, 完成. 處理 delta 中: 100% (131/131), 完成. 檢查連接... 完成。 子模組路徑 'libraries/chainbase':檢出 '94c54460bfa391aef6cadf1e3f8a4eb384c8b58e' 正克隆到 'libraries/fc'... remote: Counting objects: 1652, done. remote: Compressing objects: 100% (3/3), done. remote: Total 1652 (delta 0), reused 1 (delta 0), pack-reused 1649 接收對象中: 100% (1652/1652), 913.58 KiB | 107.00 KiB/s, 完成. 處理 delta 中: 100% (850/850), 完成. 檢查連接... 完成。 子模組路徑 'libraries/fc':檢出 'df5a17ef0704d7dd96c444bfd9a70506bcfbc057' 正克隆到 'libraries/softfloat'... remote: Counting objects: 2579, done. remote: Total 2579 (delta 0), reused 0 (delta 0), pack-reused 2579 接收對象中: 100% (2579/2579), 751.02 KiB | 150.00 KiB/s, 完成. 處理 delta 中: 100% (2361/2361), 完成. 檢查連接... 完成。 子模組路徑 'libraries/softfloat':檢出 '9dff375a6e3a9728a024b30afa127c88fcb40ea2'
cd eos (若已經在eos目錄,可省去這一步) ./eosio_build.sh
一路通暢未遇到任何問題
編譯完成,如圖所示
請參照安裝完成的圖,執行驗證的相關命令,
export PATH=${HOME}/opt/mongodb/bin:$PATH /home/guiren/opt/mongodb/bin/mongod -f /home/guiren/opt/mongodb/mongod.conf & cd /home/guiren/eos/build make test
驗證結果
當期目錄:eos
cd build sudo make install
截圖如下,
當前目錄:eos/build
cd programs/nodeos/ ./nodeos -e -p eosio --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin
啟動成功文案如下
2018-07-24T10:07:21.999 thread-0 chain_plugin.cpp:271 plugin_initialize ] initializing chain plugin 2018-07-24T10:07:22.000 thread-0 chain_plugin.cpp:508 plugin_initialize ] Starting up fresh blockchain with default genesis state. CHAINBASE: Failed to pin chainbase shared memory (of size 1024 MB) in RAM. Performance degradation is possible. CHAINBASE: Failed to pin chainbase shared memory (of size 340 MB) in RAM. Performance degradation is possible. 2018-07-24T10:07:22.201 thread-0 http_plugin.cpp:344 plugin_initialize ] configured http to listen on 127.0.0.1:8888 2018-07-24T10:07:22.201 thread-0 net_plugin.cpp:2941 plugin_initialize ] Initialize net plugin 2018-07-24T10:07:22.201 thread-0 net_plugin.cpp:2966 plugin_initialize ] host: 0.0.0.0 port: 9876 2018-07-24T10:07:22.202 thread-0 net_plugin.cpp:3036 plugin_initialize ] my node_id is e76f8b8955b7944588c11d4c97fbd649c5e18bb1f5adddc306797ba4a2f3cdc8 2018-07-24T10:07:22.202 thread-0 main.cpp:105 main ] nodeos version 75635168 2018-07-24T10:07:22.202 thread-0 main.cpp:106 main ] eosio root is /home/guiren/.local/share 2018-07-24T10:07:22.202 thread-0 controller.cpp:1252 startup ] No head block in fork db, perhaps we need to replay 2018-07-24T10:07:22.202 thread-0 controller.cpp:319 initialize_fork_db ]
出現和上面類似的文案,說明已經在生產塊了。
重新打開一個終端(之前生產節點的終端不要關閉)
當前目錄:eos
cd build/programs/cleos ./cleos get info (查看網絡信息)
網絡信息如下,
cleos命令官方文檔:https://developers.eos.io/eosio-cleos/reference#cleos-version
生成的塊和配置信息默認在當前登錄用戶目錄,
cd .local/share/eosio/nodeos/
刪除這個目錄,重啟nodeos即可重置賬號,智能合約等。
筆者建議各位開發人員將已經搭建好的eos壓縮一份保存起來,下次可直接拿來使用,畢竟搭建環境也是個費時的過程。
打包到root目錄命令,
tar -zcvf ~/eos_nodes_backup.tar.gz eos
看完上述內容,你們掌握Ubuntu中怎么搭建EOS測試環境的方法了嗎?如果還想學到更多技能或想了解更多相關內容,歡迎關注億速云行業資訊頻道,感謝各位的閱讀!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。