Ubuntu仮想マシンEOSインストールチュートリアル


EOSインストール

  • 一、ソースコードダウンロード
  • 注意事項:
  • 二、コンパイルソース
  • 注意事項:
  • 三、取付
  • 1.インストール
  • 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.メモリまたはディスクサイズが不足しているとエラーが発生した場合、メモリ制限(4 GBに変更可能)を変更できます.具体的な方法は、(1)メモリが不足している場合、メモリ制限を変更します.
    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.インストール


    (1)スクリプトのインストール実行:
    sudo./scripts/eosio_install.sh
    

    (2)手動取付入:eos/scripts/eosio_build_ubuntu.sh、実行:
    sudo make install
    

    インストールに成功しました

    2.テスト(スキップ可能)


    実行:~/eos/build/programs

    四、運行


    1.make test運転命令に入ります.
    ./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.環境変数構成:実行:/eos/build/programs/nodeos最後の行に参加する:
    export EOSIO_PATH=~/eosio/2.0/bin
    export PATH=$EOSIO_PATH:$PATH
    

    具体的なパスはインストールディレクトリの下の/binフォルダの構成が完了した後に実行します
    source ~/.bashrc
    

    コマンドcleos、nodeosなどをグローバルに使用できます

    まとめ


    この文章はeosソースコードのコンパイルとよくあるエラーをまとめた.もっと多くの問題は伝言討論を歓迎します