ntwk-calibration-8.8.0 安装

ntwk-calibration-8.8.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

参考:

  1. ntwk-calibration install-services
  2. git 设置和取消代理

你可能感兴趣的:(#,lotus)