当前位置: 首页 > news >正文

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 配置文件

  1. 备份
cp config.toml config.toml-backup
  1. 矿工配置中禁用市场子系统
[Subsystems]
  EnableMarkets = false
  1. 更改 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 FIL

Proceed? 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 t3stdetbnwh5rea6eb2ahlpb42yel46hgmh6m6s25vg7vtaejovt3wflrug4no7cwvbwr3bstfoqxecp35j5ja
        Balance: 99.99999999762657596 FIL

Piece size: 64MiB (Payload size: 49.14MiB)
Duration: 4320h0m0s
Total price: ~0.0000162 FIL (0.00000000003125 FIL per epoch)
Verified: false

Accept (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 deal
  deal uuid: cb2cc14e-1d91-4cc6-82ac-d85a8e7aefa5
  storage provider: f039424
  client wallet: f3stdetbnwh5rea6eb2ahlpb42yel46hgmh6m6s25vg7vtaejovt3wflrug4no7cwvbwr3bstfoqxecp35j5ja
  payload cid: bafykbzaced2zgtqqegy5gt4clwfdazwg7ghvdjcsztvdpsscjdcrswqduu6qu
  commp: baga6ea4seaqdib5x4rfww5qfwbbdikujgjkprjyb7bakeb4p4e6zkwtfxqlsuba
  start epoch: 1274072
  end epoch: 1792472
  provider collateral: 0
  • 查看交易状态
# boost deal-status --provider=t039424 --deal-uuid=cb2cc14e-1d91-4cc6-82ac-d85a8e7aefa5
got deal status response
  deal uuid: cb2cc14e-1d91-4cc6-82ac-d85a8e7aefa5
  deal status: Awaiting Offline Data Import
  deal label: bafykbzaced2zgtqqegy5gt4clwfdazwg7ghvdjcsztvdpsscjdcrswqduu6qu
  publish 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

参考

  1. Boost
  2. how-to-store-files-with-boost-on-filecoin

相关文章:

  • priority_queue(优先级队列的模拟使用和实现)
  • git工作中常用的命令
  • mmdetection--pointpillars-demo运行
  • 使用react-amanda快速搭建管理类型的系统
  • 由于apt-get命令不知道为什么使用不了(可能是关闭了某个访问外网的东西),所以手动在ubuntu上安装mongodb
  • shell排序算法
  • Hadoop - 本地安装 完全分布式安装 集群配置 xsync分发脚本
  • 基于视觉AI的管道高后果区预警系统
  • 计算机毕业设计ssm+vue基本微信小程序的蛋糕预订平台系统
  • CSP202206-1 归一化处理 (C/C++)
  • c++ 11 多线程支持 (std::packaged_task)
  • Spring MVC注解Controller源码流程解析--定位HandlerMethod
  • 常用排序方法、sort的实现原理、快排的优化
  • centos7 离线安装httpd
  • Redis学习之路(三)--key键操作
  • 实现windows 窗体的自己画,网上摘抄的,学习了
  • 《用数据讲故事》作者Cole N. Knaflic:消除一切无效的图表
  • 【翻译】Mashape是如何管理15000个API和微服务的(三)
  • 【跃迁之路】【585天】程序员高效学习方法论探索系列(实验阶段342-2018.09.13)...
  • laravel5.5 视图共享数据
  • LeetCode18.四数之和 JavaScript
  • Python 使用 Tornado 框架实现 WebHook 自动部署 Git 项目
  • Python打包系统简单入门
  • RedisSerializer之JdkSerializationRedisSerializer分析
  • vue从创建到完整的饿了么(11)组件的使用(svg图标及watch的简单使用)
  • 百度地图API标注+时间轴组件
  • 纯 javascript 半自动式下滑一定高度,导航栏固定
  • 个人博客开发系列:评论功能之GitHub账号OAuth授权
  • 三栏布局总结
  • 线上 python http server profile 实践
  • 新书推荐|Windows黑客编程技术详解
  • 学习笔记DL002:AI、机器学习、表示学习、深度学习,第一次大衰退
  • d²y/dx²; 偏导数问题 请问f1 f2是什么意思
  • 基于django的视频点播网站开发-step3-注册登录功能 ...
  • 数据可视化之下发图实践
  • ​flutter 代码混淆
  • ​Kaggle X光肺炎检测比赛第二名方案解析 | CVPR 2020 Workshop
  • #define与typedef区别
  • (2)Java 简介
  • (30)数组元素和与数字和的绝对差
  • (webRTC、RecordRTC):navigator.mediaDevices undefined
  • (ZT)出版业改革:该死的死,该生的生
  • (动手学习深度学习)第13章 计算机视觉---微调
  • (附源码)计算机毕业设计SSM疫情居家隔离服务系统
  • (九)信息融合方式简介
  • (企业 / 公司项目)前端使用pingyin-pro将汉字转成拼音
  • (一) storm的集群安装与配置
  • (原創) 如何讓IE7按第二次Ctrl + Tab時,回到原來的索引標籤? (Web) (IE) (OS) (Windows)...
  • (转)Linq学习笔记
  • .[hudsonL@cock.li].mkp勒索加密数据库完美恢复---惜分飞
  • .aanva
  • .a文件和.so文件
  • .NET “底层”异步编程模式——异步编程模型(Asynchronous Programming Model,APM)...
  • .net core 调用c dll_用C++生成一个简单的DLL文件VS2008
  • .net core 实现redis分片_基于 Redis 的分布式任务调度框架 earth-frost