ntwk-calibration install-services

1,编译服务install-services

  • cat lotus/Makefile
make install-services
  • 安装服务
# make install-services
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
mkdir -p /usr/local/lib/systemd/system
mkdir -p /var/log/lotus
install -C -m 0644 ./scripts/lotus-daemon.service /usr/local/lib/systemd/system/lotus-daemon.service
install -C -m 0644 ./scripts/lotus-miner.service /usr/local/lib/systemd/system/lotus-miner.service
systemctl daemon-reload

lotus-daemon and lotus-miner services installed. Don't forget to 'systemctl enable lotus-daemon|lotus-miner' for it to be enabled on startup.
  • 设置开机启动
# systemctl enable lotus-daemon
# systemctl enable lotus-miner
  • 运行lotus守护进程
# systemctl start lotus-daemon.service
  • 查看日志
# tail -f /var/log/lotus/daemon.log

2,设置环境变量

# ls /usr/local/lib/systemd/system/
lotus-daemon.service  lotus-miner.service
  • 查看服务
# cat 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
  • 添加环境变量
systemctl edit lotus-daemon.service
vim /etc/systemd/system/lotus-daemon.service.d/override.conf
[Service]
Environment="FIL_PROOFS_PARAMETER_CACHE=/storage/v27"

Environment="LOTUS_PATH=/storage/lotuswork/lotus"
Environment="LOTUS_STORAGE_PATH=/storage/lotuswork/lotusstorage"
Environment="WORKER_PATH=/storage/lotuswork/lotusworker"
Environment="TMPDIR=/storage/lotuswork/tmpdir"
Environment="FIL_PROOFS_PARENT_CACHE=/storage/lotuswork/filecoin-parents"

Environment="IPFS_GATEWAY=https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/"

Environment="FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1"
Environment="FIL_PROOFS_USE_GPU_TREE_BUILDER=1"

Environment="FIL_PROOFS_MAXIMIZE_CACHING=1"

Environment="RUST_BACKTRACE=full"
Environment="RUST_LOG=debug"
  • 不使用GPU,使用CPU
Environment="BELLMAN_NO_GPU=1"
Environment="BELLMAN_VERIFIER=cpu"
  • 重载配置
systemctl daemon-reload
systemctl start lotus-daemon.service

3,查看区块链链同步

lotus sync wait

4,初始化矿工

lotus-miner init --owner=钱包地址 --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

6,ntwk-calibration-8.13.1

# export ALL_PROXY=socks5://127.0.0.1:1080
# git config --global http.proxy 'socks5://127.0.0.1:1080'
# go env GOPROXY
# go env GO111MODULE
# go env -w GOPROXY=https://goproxy.cn,direct
# go env -w GO111MODULE=on
git clone --branch ntwk-calibration https://github.com/filecoin-project/lotus.git
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
make lotus-shed lotus-chainwatch
make install-all-services
# systemctl enable lotus-daemon
# systemctl enable lotus-miner
# systemctl enable lotus-chainwatch

参考:

  1. 如何在systemd服务中设置环境变量?
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值