ntwk-calibration-8.8.0.0インストール

7788 ワード

ntwk-calibration-8.8.0.0インストール

  • 1、アップグレードgo
  • 2、ダウンロードソース
  • 3、デーモン
  • を実行
  • 4、鉱夫
  • を作成
  • 5、運転鉱夫
  • 1,アップグレードgo

    # go version
    go version go1.14.7 linux/amd64
    

    2、ソースコードのダウンロード

  • 端末エージェント加速ダウンロード
  • # export ALL_PROXY=socks5://127.0.0.1:1080
    # git config --global http.proxy 'socks5://127.0.0.1:1080'
    
  • gitエージェント
  • をキャンセル
    git config --global --unset http.proxy
    
    git clone --branch ntwk-calibration https://github.com/filecoin-project/lotus.git
    
    # git show
    commit 2340742ebec10ff3db508a29a8669c5237117385 (HEAD -> ntwk-calibration, tag: ntwk-calibration-8.8.0, origin/ntwk-calibration)
    Author: Travis Person 
    Date:   Sat Aug 8 02:38:46 2020 +0000
    
        Genesis
    
  • コンパイル
  • env RUSTFLAGS="-C target-cpu=native -g" FFI_BUILD_FROM_SOURCE=1 make clean all lotus-bench
    
    env RUSTFLAGS="-C target-cpu=native -g" FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1 FIL_PROOFS_USE_GPU_TREE_BUILDER=1 FFI_BUILD_FROM_SOURCE=1 make clean all lotus-bench
    
    # make install
    install -C ./lotus /usr/local/bin/lotus
    install -C ./lotus-miner /usr/local/bin/lotus-miner
    install -C ./lotus-worker /usr/local/bin/lotus-worker
    
    # make install-services
    install -C ./lotus-miner /usr/local/bin/lotus-miner
    install -C ./lotus /usr/local/bin/lotus
    mkdir -p /etc/systemd/system
    mkdir -p /var/log/lotus
    install -C -m 0644 ./scripts/lotus-daemon.service /etc/systemd/system/lotus-daemon.service
    systemctl daemon-reload
    
    lotus-daemon service installed. Don't forget to run 'sudo systemctl start lotus-daemon' to start it and 'sudo systemctl enable lotus-daemon' for it to be enabled on startup.
    mkdir -p /etc/systemd/system
    mkdir -p /var/log/lotus
    install -C -m 0644 ./scripts/lotus-miner.service /etc/systemd/system/lotus-miner.service
    systemctl daemon-reload
    
    lotus-miner service installed. Don't forget to run 'sudo systemctl start lotus-miner' to start it and 'sudo systemctl enable lotus-miner' for it to be enabled on startup.
    
    systemctl daemon-reload
    
    # systemctl enable lotus-daemon
    Created symlink /etc/systemd/system/multi-user.target.wants/lotus-daemon.service → /etc/systemd/system/lotus-daemon.service.
    
    # systemctl enable lotus-miner
    Created symlink /etc/systemd/system/multi-user.target.wants/lotus-miner.service → /etc/systemd/system/lotus-miner.service.
    
  • cat /etc/systemd/system/lotus-daemon.service
  • [Unit]
    Description=Lotus Daemon
    After=network-online.target
    Requires=network-online.target
    
    [Service]
    Environment=GOLOG_FILE="/var/log/lotus/daemon.log"
    Environment=GOLOG_LOG_FMT="json"
    ExecStart=/usr/local/bin/lotus daemon
    Restart=always
    RestartSec=10
    
    MemoryAccounting=true
    MemoryHigh=8G
    MemoryMax=10G
    LimitNOFILE=8192:10240
    
    [Install]
    WantedBy=multi-user.target
    
  • cat /etc/systemd/system/lotus-miner.service
  • [Unit]
    Description=Lotus Miner
    After=network.target
    After=lotus-daemon.service
    Requires=lotus-daemon.service
    
    [Service]
    ExecStart=/usr/local/bin/lotus-miner run
    Environment=GOLOG_FILE="/var/log/lotus/miner.log"
    Environment=GOLOG_LOG_FMT="json"
    
    [Install]
    WantedBy=multi-user.target
    
  • 環境変数
  • を設定する.
    systemctl edit lotus-daemon.service
    
    vim /etc/systemd/system/lotus-daemon.service.d/override.conf
    

    3、デーモンの実行

  • 環境の表示
  • cat /usr/local/lib/systemd/system/lotus-daemon.service
    
    cat /etc/systemd/system/lotus-daemon.service.d/override.conf
    
  • 新しいバージョン
  • を参照
    cat /etc/systemd/system/lotus-daemon.service
    
    cat /etc/systemd/system/lotus-miner.service
    
  • 以前に初期化するディレクトリ
  • を削除する.
    rm -rf lotus lotusstorage/
    
  • 運転lotus-daemon
  • systemctl start lotus-daemon.service
    
    lotus sync wait
    
    lotus wallet list
    
    lotus wallet new bls
    
  • 蛇口
  • # lotus wallet balance
    10000 FIL
    

    4、鉱夫の作成

    lotus-miner init --owner=<bls-addr> --sector-size=512MiB
    
    lotus-miner init --owner=<bls-addr> --sector-size=32GiB
    

    5、鉱夫を運行する

  • 鉱夫環境変数
  • を設定する
    systemctl edit lotus-miner.service
    
    vim /etc/systemd/system/lotus-miner.service.d/override.conf
    
    systemctl daemon-reload
    
    systemctl start lotus-miner.service
    

    参照先:
  • ntwk-calibration install-services
  • gitエージェント
  • の設定とキャンセル