# go version
go version go1.14.7 linux/amd64
# export ALL_PROXY=socks5://127.0.0.1:1080
# git config --global http.proxy 'socks5://127.0.0.1:1080'
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
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
lotus-miner init --owner=<bls-addr> --sector-size=512MiB
lotus-miner init --owner=<bls-addr> --sector-size=32GiB
systemctl edit lotus-miner.service
vim /etc/systemd/system/lotus-miner.service.d/override.conf
systemctl daemon-reload
systemctl start lotus-miner.service
参考: