lotus 1.17.1-rc3 calibnet Boost

2023-10-16 05:40
文章标签 boost 1.17 lotus rc3 calibnet

本文主要是介绍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 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

参考

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

这篇关于lotus 1.17.1-rc3 calibnet Boost的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/219434

相关文章

Boost程序库入门学习

优秀的程序员要能够知其所以然,而不是重复的造轮子,近期目标是学习优秀的第三方库,同时尝试使用C++11/14新特性,然后吸取精华用到项目中去,加油~ 参考书籍: 罗剑锋写的《Boost程序库完全开发指南》和《Boost程序库探秘》,前者是一个大体的介绍,后者是针对一些诸如模板元编程等高级特性做了深入的探讨。 一、Boost库概述 Boost是一个功能强大、构造精巧、跨平台、开源并且完全

Boost库一些概念

Boost库一些概念 回调函数和异步操作的设计优势 在 Boost.Asio 中,异步操作和回调函数的设计有以下几个主要优势:1. 非阻塞 I/O非阻塞: 异步操作不会阻塞线程,允许程序在等待 I/O 操作完成的同时执行其他任务。这提高了程序的响应性和并发处理能力。事件驱动: 通过事件循环和回调函数,程序可以以事件驱动的方式处理 I/O 操作,避免了传统阻塞 I/O 模型中的线程阻塞问题。2.

boost.graph之属性

相关宏 BOOST_INSTALL_PROPERTY #define BOOST_INSTALL_PROPERTY(KIND, NAME) \template <> struct property_kind<KIND##_##NAME##_t> { \typedef KIND##_property_tag type; \} 最终形式为 template <> struct proper

boost和buck-boost拓扑原理

如果是交流电可以用变压器升压: boost升压直接的问题就是电流随着电压的升高会降低,这个时候可以使用PD技术升高功率 boost拓扑: MOS关断的时候电感右侧的电压是VO + VD,电感左侧的电压是VIN,显然电感右侧电压大于电池电压VIN: BUCK---BOOST: 电磁兼容EMC包括电磁干扰EMI和电磁抗干扰EMS:有空对这些进行专门的学习:

Ubuntu安装boost,protobuf、moduo

一、Ubuntu安装muduo muduo库是基于boost开发的,确保先安装了boost(对boost版本有要求),还需要先安装protobuf,curl库 库版本boost1.70.0protobuf3.14.0curl7.74.0muduo2.0.2 1、Ubuntu安装boost # 更新资源列表sudo apt update# 安装依赖sudo apt install bu

C++ boost::upgrade_lock boost::upgrade_to_unique_lock如何使用 例子

upgrade_lock将可将读锁(shared_lock)升级为upgrade_lock,与shared_lock不互斥,与别的upgrade_lock和unique_lock互斥。 也就是说线程A获得mutex的upgrade_lock后,线程B、C等还可以获得mutex的share_mutex,反之亦然。 upgrade_to_unique_lock可将upgrade_lock升级为独占

编译并使用Boost 1.57

windows下boost库编译 1.首先在http://www.boost.org/下载源代码。 2.解压源代码到磁盘(如D:\boost_1_57_0)。 3.生成bjam.exe可执行文件:       用VS2010的命令行来实现,后期也是使用VS2010的命令行来实现boost库的编译。步骤为: 点击开始—>所有程序--> Microsoft Visual Studio 20

C++的boost学习--内存管理

boost库的内存处理 智能指针 1,scoped_ptr 不允许拷贝,赋值,只能在被声明的作用域中使用,不需要使用delete释放资源,自动释放资源,可以获得与原始指针同样的速度。 #include<iostream> #include<boost\smart_ptr.hpp> using namespace std; void usageScopedPtr();

c++的boost库学习笔记

c++的boost库学习 boost和stlport编译,编译过程好麻烦,根据网上教程和boost完全开发指南,加自己摸索才勉强编译完成,做个笔记总结一下,具体编译方法,暂且不写   1,timer类,用于类似性能测试等计算时间。 下面代码是线程的helloworld和timer类的使用例子 #include<iostream> #include<boost/threa