系列文章目录
lotus
Boost 作为客户端
- 系列文章目录
- 前言
- 一、同步区块高度
- 二、boost 初始化
- 1. 生成钱包地址
- 2. boost设置默认钱包地址
- 三、boostx向存储市场添加资金
- 四、发单
- 五、离线交易
- 参考
前言
Boost 作为客户端
一、同步区块高度
- 可以远程调用其它api,也可以本机同步区块高度
export FULLNODE_API_INFO
# lotus sync wait
# tail .bashrc
# api
export FULLNODE_API_INFO=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJyZWFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXX0.2MFStYb9gpDW_s-AG-th3Dei2qyEQFMITPckK7--fqk:/ip4/127.0.0.1/tcp/1234/http
二、boost 初始化
1. 生成钱包地址
# boost -vv init
2022-08-22T17:30:55.724+0800 INFO boost boost/init_cmd.go:46 default wallet set {"wallet": "f3qn6fjvwb5xfihgynees2njtsza27e75lk3zggbhepb7ghhzzlooopncbthk54dl32h5tmi64frvkwdtosdra"}
2022-08-22T17:30:55.724+0800 INFO boost boost/init_cmd.go:53 wallet balance {"value": "0"}
2022-08-22T17:30:55.725+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
# lotus send f3qn6fjvwb5xfihgynees2njtsza27e75lk3zggbhepb7ghhzzlooopncbthk54dl32h5tmi64frvkwdtosdra 30000
# lotus wallet balance f3qn6fjvwb5xfihgynees2njtsza27e75lk3zggbhepb7ghhzzlooopncbthk54dl32h5tmi64frvkwdtosdra
30000 FIL
# boost wallet list
# lotus wallet list
Address Balance Nonce Defaultt3qk5f26bhigub44rjj7bi2gb5egfhtklf5vcol3r4mdkcmxq2wima5w6rmq7zbqecl74btgsywlgwswyuwdaa 200000 FIL 0
# lotus wallet export t3qk5f26bhigub44rjj7bi2gb5egfhtklf5vcol3r4mdkcmxq2wima5w6rmq7zbqecl74btgsywlgwswyuwdaa > key.wallet
2. boost设置默认钱包地址
# boost wallet import key.wallet
imported key f3qk5f26bhigub44rjj7bi2gb5egfhtklf5vcol3r4mdkcmxq2wima5w6rmq7zbqecl74btgsywlgwswyuwdaa successfully!
# boost wallet list
# boost wallet set-default t3qk5f26bhigub44rjj7bi2gb5egfhtklf5vcol3r4mdkcmxq2wima5w6rmq7zbqecl74btgsywlgwswyuwdaa
# boostx stats
Total SPs on chain: 2
Total SPs with minimum power: 1
Error: getting provider multi-address: storage provider f01000 has no multiaddrs set on-chainTotal Boost nodes: 0
Total Boost raw power: 0
Total Boost quality adj power: 0
Total Lotus Markets nodes: 0
Total SPs with minimum power: 1
Total Indexer nodes: 0
三、boostx向存储市场添加资金
# boostx market-add 100
2022-08-22T18:55:38.945+0800 INFO boostx boostx/utils_cmd.go:93 selected wallet {"wallet": "f3qk5f26bhigub44rjj7bi2gb5egfhtklf5vcol3r4mdkcmxq2wima5w6rmq7zbqecl74btgsywlgwswyuwdaa"}
about to send message with the following gas costs
max fee: 0.000000000996134128 FIL (absolute maximum amount you are willing to pay to get your transaction confirmed)
gas fee cap: 0.000000000000000209 FIL
gas limit: 4766192
gas premium: 0.000000000000000209 FIL
basefee: 0.0000000000000001 FILProceed? Yes [y] / No [n]:
yes
2022-08-22T18:56:07.983+0800 INFO boostx boostx/utils_cmd.go:116 submitted market-add message {"cid": "bafy2bzacedqqz6cl4pyilq7boxgprkahvkvn6uvdp2qz7xbr7hzrrzbcmea3q"}
# boost init
2022-08-22T19:01:48.692+0800 INFO boost boost/init_cmd.go:46 default wallet set {"wallet": "f3qk5f26bhigub44rjj7bi2gb5egfhtklf5vcol3r4mdkcmxq2wima5w6rmq7zbqecl74btgsywlgwswyuwdaa"}
2022-08-22T19:01:48.692+0800 INFO boost boost/init_cmd.go:53 wallet balance {"value": "199900 FIL"}
2022-08-22T19:01:48.693+0800 INFO boost boost/init_cmd.go:65 market balance {"escrow": "100 FIL", "locked": "0"}
四、发单
root@ubuntu-05:~# lotus client query-ask t01003
Ask: t01003
Price per GiB: 0 FIL
Verified Price per GiB: 0 FIL
Max Piece size: 2 KiB
Min Piece size: 256 B
# boostx generate-car /root/f3.txt /root/f3.car
Payload CID: bafk2bzaceamepf7hlecxfwlcskwi2hzld2hmzsepbg6yfi5uduu5gby2qqj3q
# boostx commp /root/f3.car
[flexi_logger][ERRCODE::Time] flexi_logger has to work with UTC rather than with local time, caused by IndeterminateOffsetSee https://docs.rs/flexi_logger/latest/flexi_logger/error_info/index.html#time
2022-08-22T11:34:28.806 INFO filcrypto::util::types > generate_piece_commitment: start
2022-08-22T11:34:28.818 INFO filcrypto::util::types > generate_piece_commitment: end
CommP CID: baga6ea4seaqdi7dqjyxexcptitihnc3iv22w6gwgr3n2ug4hp4akwqgi6ezagpi
Piece size: 512
Car file size: 472
五、离线交易
# boostx generate-car /root/f3.txt /root/f3.car
Payload CID: bafk2bzaceamepf7hlecxfwlcskwi2hzld2hmzsepbg6yfi5uduu5gby2qqj3q
# boostx commp /root/f3.car
[flexi_logger][ERRCODE::Time] flexi_logger has to work with UTC rather than with local time, caused by IndeterminateOffsetSee https://docs.rs/flexi_logger/latest/flexi_logger/error_info/index.html#time
2022-08-22T11:34:28.806 INFO filcrypto::util::types > generate_piece_commitment: start
2022-08-22T11:34:28.818 INFO filcrypto::util::types > generate_piece_commitment: end
CommP CID: baga6ea4seaqdi7dqjyxexcptitihnc3iv22w6gwgr3n2ug4hp4akwqgi6ezagpi
Piece size: 512
Car file size: 472
# boost offline-deal --verified=false --provider=t01003 --commp=baga6ea4seaqdi7dqjyxexcptitihnc3iv22w6gwgr3n2ug4hp4akwqgi6ezagpi --car-size=472 --piece-size=512 --payload-cid=bafk2bzaceamepf7hlecxfwlcskwi2hzld2hmzsepbg6yfi5uduu5gby2qqj3q
sent deal proposal for offline dealdeal uuid: 947fc2cc-6057-4496-81c4-bf1f2673c67astorage provider: f01003client wallet: f3qk5f26bhigub44rjj7bi2gb5egfhtklf5vcol3r4mdkcmxq2wima5w6rmq7zbqecl74btgsywlgwswyuwdaapayload cid: bafk2bzaceamepf7hlecxfwlcskwi2hzld2hmzsepbg6yfi5uduu5gby2qqj3qcommp: baga6ea4seaqdi7dqjyxexcptitihnc3iv22w6gwgr3n2ug4hp4akwqgi6ezagpistart epoch: 98070end epoch: 616470provider collateral: 0

root@ubuntu-05:~# cp /root/f3.car /data/
- miner访问f3.car文件
root@ubuntu-03:~# df -Th
192.168.2.30:/data nfs4 98G 0 93G 0% /ubuntu-05-data
# boostd import-data 947fc2cc-6057-4496-81c4-bf1f2673c67a /ubuntu-05-data/f3.car
Offline deal import for v1.2.0 deal 947fc2cc-6057-4496-81c4-bf1f2673c67a scheduled for execution
参考
- boost

















