本文主要是介绍lotus 1.17.1-rc3 calibnet Boost,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
系列文章目录
lotus
Boost
- 系列文章目录
- 前言
- Boost
- 一、Boost 存储提供商
- 1. lotus daemon 和 lotus-miner run
- 2. Boost需要2个钱包地址
- 3. 将发布存储交易钱包设置为控制钱包
- 4. 设置Boost迁移所需的环境变量
- 二、关闭 lotus-miner
- 三、源码编译Boost
- 四、lotus-miner 迁移到 Boost
- 五、更新 lotus-miner config 配置文件
- 六、运行lotus-miner
- 七、运行 boostd
- 八、Web UI
- Boost 客户端
- 1.本地同步区块高度
- 2.初始化客户端
- 3.发单
- lotus client deal
- boost
- 参考
前言
Boost
一、Boost 存储提供商
1. lotus daemon 和 lotus-miner run
# lotus-miner --version
lotus-miner version 1.17.1-rc3+calibnet+git.079dab0d7
# lotus-miner actor control list
name ID key use balance
owner t039420 t3w2y245h...
worker t039421 t3wqdvbzm... other
control-0 t039611 t3uxhdtxl... post
2. Boost需要2个钱包地址
- miner 已经设置了提交时空证明
post
地址,使用这个地址作为 Boost PUBLISH_STORAGE_DEALS_WALLET - 新建钱包地址作为 Boost COLLAT_WALLET 交易抵押钱包
# lotus wallet new bls
t3u5hg64rdxc75xq63xyhegvccplm6pe34lkm7yoqvatqjaqcwqav33daj4fimqdjwldk6dnntt3jueyliivqa# lotus send t3u5hg64rdxc75xq63xyhegvccplm6pe34lkm7yoqvatqjaqcwqav33daj4fimqdjwldk6dnntt3jueyliivqa 200
3. 将发布存储交易钱包设置为控制钱包
- 使用已有
post
地址
4. 设置Boost迁移所需的环境变量
- 参考
export $(lotus auth api-info --perm=admin)
export $(lotus-miner auth api-info --perm=admin)export APISEALER=`lotus-miner auth api-info --perm=admin`
export APISECTORINDEX=`lotus-miner auth api-info --perm=admin`
vim .bashrc
添加到环境变量
# lotus auth api-info --perm=admin
# lotus-miner auth api-info --perm=admin
二、关闭 lotus-miner
- 停止接收订单,做完未完成的订单
- 备份lotus-miner 元数据
- 参考 Backup and restore
lotus-miner backup /root/lotus-backups/2020-11-15/backup.cbor
- 关闭 lotus-miner
- 备份 lotus-miner 数据存储(从 Boost 回滚到 Lotus)
mkdir lotus-miner-datastore-backup
- 参考
lotus-shed market export-datastore --repo <repo> --backup-dir <backup-dir>
# lotus-shed market export-datastore --repo /seal/miner/ --backup-dir /root/lotus-miner-datastore-backup/
Exporting key /deals/provider/storage-ask/1/latest
Exporting key /deals/provider/storage-ask/versions/current
Exporting key /deals/provider/versions/current
Exporting key /retrievals/provider/retrieval-ask/1/latest
Exporting key /retrievals/provider/retrieval-ask/versions/current
Exporting key /retrievals/provider/versions/current
Exporting key /storagemarket/cid-infos/versions/current
Exporting key /storagemarket/pieces/versions/current
2022-09-02T02:48:18.767Z INFO backupds backupds/datastore.go:75 Starting datastore backup
2022-09-02T02:48:18.767Z INFO backupds backupds/datastore.go:130 Datastore backup done
Wrote backup file to /root/lotus-miner-datastore-backup/markets.datastore.backup
三、源码编译Boost
- Building and installing
# go version
go version go1.18.3 linux/amd64
# rustc --version
rustc 1.63.0-nightly (43347397f 2022-06-23)
- Node 16.x
# curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
# apt-get install -y nodejs
# apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config curl clang build-essential hwloc libhwloc-dev wget -y
# node --version
v16.17.0
- AMD CPU 编译环境变量
export RUSTFLAGS="-C target-cpu=native -g"
export FFI_BUILD_FROM_SOURCE=1
# git clone https://github.com/filecoin-project/boost
# cd boost/
# git checkout v1.4.0-rc2
# make build
# make install
# make install
install -C ./boost /usr/local/bin/boost
install -C ./boostd /usr/local/bin/boostd
install -C ./boostx /usr/local/bin/boostx
install -C ./devnet /usr/local/bin/devnet
四、lotus-miner 迁移到 Boost
echo $APISEALER && echo $APISECTORINDEX && echo $PUBLISH_STORAGE_DEALS_WALLET && echo $COLLAT_WALLET
boostd --boost-repo=/seal/boost --vv migrate-monolith \--import-miner-repo=/seal/miner \--api-sealer=$APISEALER \--api-sector-index=$APISECTORINDEX \--wallet-publish-storage-deals=$PUBLISH_STORAGE_DEALS_WALLET \--wallet-deal-collateral=$COLLAT_WALLET \--max-staging-deals-bytes=50000000000
五、更新 lotus-miner config 配置文件
- 备份
cp config.toml config.toml-backup
- 矿工配置中禁用市场子系统
[Subsystems]EnableMarkets = false
- 更改 miner libp2p 端口
六、运行lotus-miner
七、运行 boostd
nohup boostd --boost-repo=/seal/boost --vv run >> /var/log/calibnet/boostd.log 2>&1 &
八、Web UI
- 构建 React 前端
~/boost# cd react/
# npm install --force
# npm run build
curl http://localhost:8080
Boost 客户端
- 另一台服务器
1.本地同步区块高度
lotus sync wait
2.初始化客户端
- How to store files with Boost on Filecoin
- 默认目录
/root/.boost-client
# boost -vv init
2022-09-02T15:39:46.283+0800 INFO boost boost/init_cmd.go:46 default wallet set {"wallet": "f3stdetbnwh5rea6eb2ahlpb42yel46hgmh6m6s25vg7vtaejovt3wflrug4no7cwvbwr3bstfoqxecp35j5ja"}
2022-09-02T15:39:46.285+0800 INFO boost boost/init_cmd.go:53 wallet balance {"value": "0"}
2022-09-02T15:39:46.286+0800 WARN boost boost/init_cmd.go:58 market actor is not initialised, you must add funds to it in order to send online deals
- 转币到钱包地址
# boost wallet list
- 存储市场添加资金 用于抵押
# boostx market-add 200
2022-09-02T15:54:51.148+0800 INFO boostx boostx/utils_cmd.go:93 selected wallet {"wallet": "f3stdetbnwh5rea6eb2ahlpb42yel46hgmh6m6s25vg7vtaejovt3wflrug4no7cwvbwr3bstfoqxecp35j5ja"}
about to send message with the following gas costs
max fee: 0.00000000276515424 FIL (absolute maximum amount you are willing to pay to get your transaction confirmed)
gas fee cap: 0.00000000000000012 FIL
gas limit: 23042952
gas premium: 0.000000000000000043 FIL
basefee: 0.0000000000000001 FILProceed? Yes [y] / No [n]:
y
2022-09-02T15:55:20.989+0800 INFO boostx boostx/utils_cmd.go:116 submitted market-add message {"cid": "bafy2bzaceadzaviib7nwueqfhbuqmh5pi6vnbij5kblhqwsvenqz6mnpukfhm"}
3.发单
lotus client deal
# lotus client generate-car /seal/car-data/file01.txt /seal/car-data/file011.car
# lotus client import --car /seal/car-data/file011.car
Import 1662104200505050839, Root bafykbzaced2zgtqqegy5gt4clwfdazwg7ghvdjcsztvdpsscjdcrswqduu6qu# lotus client deal
Data CID (from lotus client import): bafykbzaced2zgtqqegy5gt4clwfdazwg7ghvdjcsztvdpsscjdcrswqduu6qu
.. calculating data size
Deal duration (days): 180
Miner Addresses (f0.. f0..), none to find: t0矿工
.. querying miner asks
-----
Proposing from t3stdetbnwh5rea6eb2ahlpb42yel46hgmh6m6s25vg7vtaejovt3wflrug4no7cwvbwr3bstfoqxecp35j5jaBalance: 99.99999999762657596 FILPiece size: 64MiB (Payload size: 49.14MiB)
Duration: 4320h0m0s
Total price: ~0.0000162 FIL (0.00000000003125 FIL per epoch)
Verified: falseAccept (yes/no): yes
.. executing
Deal (t039424) CID: bafyreigr5rv5rejr76lb6rhru4fi65q3u6ghoggv7h6v2zjx6hfb3crcwu
lotus client deal bafykbzaced2zgtqqegy5gt4clwfdazwg7ghvdjcsztvdpsscjdcrswqduu6qu t039424 0.00000000003125 518400
- 接收交易正常
boost
- 查询矿工号报价
lotus state miner-info 矿工号
lotus client query-ask 矿工号
- 离线交易,报价交易需要设置为0
# boostx generate-car ./file01.txt ./file01.car
Payload CID: bafykbzaced2zgtqqegy5gt4clwfdazwg7ghvdjcsztvdpsscjdcrswqduu6qu# boostx commp ./file01.car
CommP CID: baga6ea4seaqdib5x4rfww5qfwbbdikujgjkprjyb7bakeb4p4e6zkwtfxqlsuba
Piece size: 67108864
Car file size: 51523000
# boost offline-deal --verified=false --payload-cid=bafykbzaced2zgtqqegy5gt4clwfdazwg7ghvdjcsztvdpsscjdcrswqduu6qu --commp=baga6ea4seaqdib5x4rfww5qfwbbdikujgjkprjyb7bakeb4p4e6zkwtfxqlsuba --piece-size=67108864 --car-size=51523000 --provider=t039424
sent deal proposal for offline dealdeal uuid: cb2cc14e-1d91-4cc6-82ac-d85a8e7aefa5storage provider: f039424client wallet: f3stdetbnwh5rea6eb2ahlpb42yel46hgmh6m6s25vg7vtaejovt3wflrug4no7cwvbwr3bstfoqxecp35j5japayload cid: bafykbzaced2zgtqqegy5gt4clwfdazwg7ghvdjcsztvdpsscjdcrswqduu6qucommp: baga6ea4seaqdib5x4rfww5qfwbbdikujgjkprjyb7bakeb4p4e6zkwtfxqlsubastart epoch: 1274072end epoch: 1792472provider collateral: 0
- 查看交易状态
# boost deal-status --provider=t039424 --deal-uuid=cb2cc14e-1d91-4cc6-82ac-d85a8e7aefa5
got deal status responsedeal uuid: cb2cc14e-1d91-4cc6-82ac-d85a8e7aefa5deal status: Awaiting Offline Data Importdeal label: bafykbzaced2zgtqqegy5gt4clwfdazwg7ghvdjcsztvdpsscjdcrswqduu6qupublish cid: <nil>chain deal id: 0
- file01.car文件传输miner机
- 离线导入交易
# boostd --boost-repo=/seal/boost import-data cb2cc14e-1d91-4cc6-82ac-d85a8e7aefa5 /car-data/file01.car
Offline deal import for v1.2.0 deal cb2cc14e-1d91-4cc6-82ac-d85a8e7aefa5 scheduled for execution
参考
- Boost
- how-to-store-files-with-boost-on-filecoin
这篇关于lotus 1.17.1-rc3 calibnet Boost的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!