filecoin-project / boost

Boost is a tool for Filecoin storage providers to manage data storage and retrievals on Filecoin.
Other
111 stars 68 forks source link

chore: refactor allocate command #1912

Closed LexLuthr closed 5 months ago

LexLuthr commented 5 months ago

Allows using a file to allocate in CSV format. The delimiter is ","

Fixes https://github.com/filecoin-project/boost/issues/1897

root@03d705eacb40:/app# boost allocate --pf ./text.txt 
about to send message with the following gas costs
max fee:      0.00000000340735296 FIL (absolute maximum amount you are willing to pay to get your transaction confirmed)
gas fee cap:  0.00000000000000012 FIL
gas limit:    28394608
gas premium:  0.000000000000000035 FIL
basefee:      0.0000000000000001 FIL

Proceed? Yes [Y/y] / No [N/n], Ctrl+C (^C) to exit y
2024-04-17T10:06:31.060Z        INFO    boost   boost/direct_deal.go:280        submitted data cap allocation message[s]
2024-04-17T10:06:31.060Z        INFO    boost   boost/direct_deal.go:281        waiting for message to be included in a block
AllocationID  Client  Miner  PieceCid                                                          PieceSize  TermMin  TermMax  
13            1007    1000   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
16            1007    1000   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
18            1007    1006   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
21            1007    1006   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
22            1007    1006   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
24            1007    1006   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
4             1007    1000   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
6             1007    1000   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
7             1007    1000   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
9             1007    1000   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
15            1007    1000   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
20            1007    1006   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
8             1007    1000   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
10            1007    1000   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
11            1007    1000   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
12            1007    1000   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
14            1007    1000   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
17            1007    1006   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
19            1007    1006   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
2             1007    1000   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
23            1007    1006   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
3             1007    1000   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
5             1007    1000   baga6ea4seaqpfonfro6j3gcw4uxkxbivlqn2fghx5dpulc6sbi5noz7bcvzmuiq  2048       518400   5256000  
  Expiration: 213775
root@03d705eacb40:/app# cat text.txt | wc -l
23
LexLuthr commented 5 months ago

@beck-8 @rvagg Please review and let me know if we need to change file format.

beck-8 commented 5 months ago

looks great

LexLuthr commented 5 months ago

@beck-8 Can you please also test this as a user? A real world test would reveal any missing features which might make life easier for users.

beck-8 commented 5 months ago

@beck-8 Can you please also test this as a user? A real world test would reveal any missing features which might make life easier for users.

Sorry, I don't have datacap credit, so I can't do the test.