ntwk-calibration install-services

ntwk-calibration install-services 安装服务

  • 1,编译服务`install-services`
  • 2,设置环境变量
  • 3,查看区块链链同步
  • 4,初始化矿工
  • 5,矿工环境变量

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"
  • 重载配置
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

参考:

  1. 如何在systemd服务中设置环境变量?

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