ntwk-calibration install-services
install Services
2023-09-14 09:09:49 时间
ntwk-calibration install-services 安装服务
1,编译服务install-services
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
参考:
相关文章
- install Mac OS on Vmware
- pip install 安装出现问题:UnicodeEncodeError: 'ascii' codec can't encode characters in position XX的解决办法
- Python pip install virtualenv创建虚拟环境
- npm install时报平台不兼容Unsupported platform for xxx的解决办法:npm install -f强制安装(centos7下安装vite2 vue依赖时出现这个问题)
- Heroku Toolbet install
- undefined reference to libiconv_open ext/iconv/.libs/iconv.o by install phpsource
- 已解决Encountered error while trying to install package.wxPython
- file /usr/share/mysql/charsets/README from install of MySQL-server-5.1.73-1.glibc23.i386 conflicts with file from package mysql-libs-5.1.73-8.el6_8.i686
- 报错:Cannot remove entries from nonexistent file c:program filesanaconda3libsite-packageseasy-install.pth
- Android10之INSTALL_FAILED_OLDER_SDK解决方法