• lotus 1.17.1-rc3 calibnet Boost


    系列文章目录

    lotus



    前言

    Boost

    一、Boost 存储提供商

    1. lotus daemon 和 lotus-miner run

    # lotus-miner --version
    lotus-miner version 1.17.1-rc3+calibnet+git.079dab0d7
    
    • 1
    • 2
    # lotus-miner actor control list
    name       ID       key           use    balance                       
    owner      t039420  t3w2y245h...          
    worker     t039421  t3wqdvbzm...  other   
    control-0  t039611  t3uxhdtxl...  post       
    
    • 1
    • 2
    • 3
    • 4
    • 5

    2. Boost需要2个钱包地址

    • miner 已经设置了提交时空证明 post地址,使用这个地址作为 Boost PUBLISH_STORAGE_DEALS_WALLET
    • 新建钱包地址作为 Boost COLLAT_WALLET 交易抵押钱包
    # lotus wallet new bls
    t3u5hg64rdxc75xq63xyhegvccplm6pe34lkm7yoqvatqjaqcwqav33daj4fimqdjwldk6dnntt3jueyliivqa
    
    # lotus send t3u5hg64rdxc75xq63xyhegvccplm6pe34lkm7yoqvatqjaqcwqav33daj4fimqdjwldk6dnntt3jueyliivqa 200
    
    • 1
    • 2
    • 3
    • 4

    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`
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • vim .bashrc添加到环境变量
    # lotus auth api-info --perm=admin
    # lotus-miner auth api-info --perm=admin
    
    • 1
    • 2

    二、关闭 lotus-miner

    • 停止接收订单,做完未完成的订单
    • 备份lotus-miner 元数据
    • 参考 Backup and restore
    lotus-miner backup /root/lotus-backups/2020-11-15/backup.cbor
    
    • 1
    • 关闭 lotus-miner
    • 备份 lotus-miner 数据存储(从 Boost 回滚到 Lotus)
    mkdir lotus-miner-datastore-backup
    
    • 1
    • 参考 lotus-shed market export-datastore --repo --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
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12

    三、源码编译Boost

    # go version
    go version go1.18.3 linux/amd64
    
    • 1
    • 2
    # rustc --version
    rustc 1.63.0-nightly (43347397f 2022-06-23)
    
    • 1
    • 2
    • 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
    
    • 1
    • 2
    • 3
    # node --version
    v16.17.0
    
    • 1
    • 2
    • AMD CPU 编译环境变量
    export RUSTFLAGS="-C target-cpu=native -g"
    export FFI_BUILD_FROM_SOURCE=1
    
    • 1
    • 2
    # git clone https://github.com/filecoin-project/boost
    # cd boost/
    # git checkout v1.4.0-rc2
    
    • 1
    • 2
    • 3
    # make build
    # make install
    
    • 1
    • 2
    # 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
    
    • 1
    • 2
    • 3
    • 4
    • 5

    四、lotus-miner 迁移到 Boost

    echo $APISEALER && echo $APISECTORINDEX && echo $PUBLISH_STORAGE_DEALS_WALLET && echo $COLLAT_WALLET
    
    • 1
    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 
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    五、更新 lotus-miner config 配置文件

    1. 备份
    cp config.toml config.toml-backup
    
    • 1
    1. 矿工配置中禁用市场子系统
    [Subsystems]
      EnableMarkets = false
    
    • 1
    • 2
    1. 更改 miner libp2p 端口

    六、运行lotus-miner

    七、运行 boostd

    nohup boostd --boost-repo=/seal/boost --vv run >> /var/log/calibnet/boostd.log 2>&1 &
    
    • 1

    八、Web UI

    • 构建 React 前端
    ~/boost# cd react/
    # npm install --force
    # npm run build
    
    • 1
    • 2
    • 3
    curl http://localhost:8080
    
    • 1

    在这里插入图片描述

    Boost 客户端

    • 另一台服务器

    1.本地同步区块高度

    lotus sync wait
    
    • 1

    2.初始化客户端

    # 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
    
    • 1
    • 2
    • 3
    • 4
    • 转币到钱包地址
    # boost wallet list	
    
    • 1
    • 存储市场添加资金 用于抵押
    # 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"}
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12

    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
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    lotus client deal bafykbzaced2zgtqqegy5gt4clwfdazwg7ghvdjcsztvdpsscjdcrswqduu6qu t039424 0.00000000003125 518400
    
    • 1
    • 接收交易正常
      在这里插入图片描述

    boost

    • 查询矿工号报价
    lotus state miner-info 矿工号
    lotus client query-ask 矿工号
    
    • 1
    • 2
    • 离线交易,报价交易需要设置为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
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    # 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
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 查看交易状态
    # 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
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 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
    • 2

    参考

    1. Boost
    2. how-to-store-files-with-boost-on-filecoin
  • 相关阅读:
    VScode中使用svn常用简单操作
    JNA java调用dll
    35 个 Spark 常用算子总结
    2024年第十五届蓝桥杯C/C++B组复盘(持续更新)
    立体合唱声效果器:Roland Cloud JUNO-60 Mac
    java计算机毕业设计基于springboo+vue的小区物业管理系统
    mybatis常见用法总结
    MySQL8.0爬坑二三事
    Prometheus :(一)基本概念
    EasyRL-第二章
  • 原文地址:https://blog.csdn.net/u010953692/article/details/126648388