EOS安裝
- 一、原始碼下載
- 注意事項:
- 二、編譯原始碼
- 注意事項:
- 三、安裝
- 1.install安裝
- 2.測驗(可跳過)
- 四、運行
- 總結
一、原始碼下載
git clone https://github.com/EOSIO/eos --recursive
注意事項:
1.如果git clone失敗或者速度過慢,可以修改host或者換源
(1)換源參考:
修改為國內源,主要有利于后面編譯時的下載,
(2)修改host :
sudo vim /etc/hosts
在檔案末尾加上:192.30.253.113 github.com
2.如果報錯
RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
fatal: The remote end hung up unexpectedly
fatal: 過早的檔案結束符(EOF)
fatal: index-pack failed
意味著http快取過小,輸入:
git config --global http.postBuffer 524288000
并打開vim ~/.bashrc,在檔案末尾加上:
export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1
保存退出后,運行source ~/.bashrc生效
二、編譯原始碼
執行:
cd ~/eos/scripts
sudo ./eosio_build.sh
一鍵安裝
注意事項:
1.如果報錯出現記憶體或磁盤大小不足,可以修改記憶體限制(可以修改至4GB)
具體方法為:
(1)記憶體不足時,修改記憶體限制:
打開:eos/scripts/eosio_build_ubuntu.sh,找到:
if [ "${MEM_MEG}" -lt 7000 ]; then
將7000修改為4000保存即可
(2)擴展磁盤,可參考:
Ubuntu VM虛擬機擴展磁盤
2.如果出現
clang++: error: unable to execute command: Killed
clang++: error: assembler command failed due to signal (use -v to see invocation)
'''
***
'''
make[1]: *** [libraries/testing/CMakeFiles/chain_tester.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
(1)查看swap區是否足夠:
free -h
(2)如果swap磁區不足,可以使用
sudo fallocate -l 4G /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
備份檔案
sudo cp /etc/fstab /etc/fstab.bak
修改檔案
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
三、安裝
1.install安裝
(1)腳本安裝
執行:
sudo./scripts/eosio_install.sh
(2)手動安裝
進入:~/eos/build/programs,執行:
sudo make install
即可安裝成功
2.測驗(可跳過)
執行:make test
四、運行
1.進入/eos/build/programs/nodeos
運行命令:
./nodeos -e -p eosio \
--plugin eosio::producer_plugin \
--plugin eosio::producer_api_plugin \
--plugin eosio::chain_api_plugin \
--plugin eosio::http_plugin \
--plugin eosio::history_plugin \
--plugin eosio::history_api_plugin \
--filter-on="*" \
--access-control-allow-origin='*' \
--contracts-console \
--http-validate-host=false \
--verbose-http-errors >> nodeos.log 2>&1 &
即可成功運行節點(注意權限問題)
2.環境變數配置:
執行:sudo vim ~/.bashrc
在最后一行加入:
export EOSIO_PATH=~/eosio/2.0/bin
export PATH=$EOSIO_PATH:$PATH
具體路徑為安裝目錄下的/bin檔案夾
配置完成后執行
source ~/.bashrc
即可在全域使用命令cleos、nodeos等
總結
該文章對eos原始碼編譯及常見錯誤進行了總結歸納,更多問題歡迎留言討論
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/42405.html
標籤:java
