Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paginate and filter storage client deals list #5886

Closed
wants to merge 4 commits into from

Conversation

aarshkshah1992
Copy link
Contributor

@aarshkshah1992 aarshkshah1992 commented Mar 26, 2021

@aarshkshah1992 aarshkshah1992 changed the base branch from master to feat/markets-v1.2.0 March 26, 2021 11:47
@aarshkshah1992
Copy link
Contributor Author

@dirkmc @jennijuju

All possible options with which we can filter

arshshah@Aarshs-MacBook-Pro lotus % lotus client list-deals --help                                                      
NAME:
   lotus client list-deals - List storage market deals

USAGE:
   also supports pagination, please see supported options for more details

CATEGORY:
   STORAGE

OPTIONS:
   --verbose, -v                 print verbose deal details (default: false)
   --color                       use color in display output (default: true)
   --watch                       watch deal updates in real-time, rather than a one time list (default: false)
   --hide-failed                 hide failed/failing deals (default: false)
   --creation-time-offset value  minimum creation time offset of the deals to include in the deal list page (default: no-op)
   --limit value                 number of deals to show in the deal list page (default: 50)
   --min-start-epoch value       minimum start epoch of the deals to include in the deal list page (default: no-op)
   --max-end-epoch value         maximum end epoch of the deals to include in the deal list page (default: no-op)
   --help, -h                    show help (default: false)

All Deals

aarshshah@Aarshs-MacBook-Pro lotus % lotus client list-deals -v

Created                    DealCid                                                      DealId  Provider  State                         On Chain?       Slashed?  PieceCID                                                          Size       Price                     Duration  TransferChannelID                                                                                                              TransferStatus  Verified  Message
2021-03-26T13:24:26+05:30  bafyreibcacybtma7rdfycjkognrl6wdty3lkmrdvys4jtoqbiwi2uziuaa  10      f01000    StorageDealAwaitingPreCommit  Y (epoch 1629)  N         baga6ea4seaqkmjd7eh6ypntkvtnfp65fjgqhhta44vik7ths7hkrrp32scruujy  1.984 KiB  0.000402281072888688 FIL  1300994   12D3KooWHxkZnb2UHS23QAE6Hs2GptYQpziQXaHwpHjnZGHdXtkf-12D3KooWGBzFUDEw14UtJg1MeYrN5b8UNnyNBgqjumrB9p3wfqQ7-1616743172515884001  Completed       false     
2021-03-26T13:26:21+05:30  bafyreic33ishws3swia2j4wwajlavv7ullpii237pqygtm4o4fwttsdayu  11      f01000    StorageDealAwaitingPreCommit  Y (epoch 1630)  N         baga6ea4seaqkmjd7eh6ypntkvtnfp65fjgqhhta44vik7ths7hkrrp32scruujy  1.984 KiB  0.00040227210578268 FIL   1300965   12D3KooWHxkZnb2UHS23QAE6Hs2GptYQpziQXaHwpHjnZGHdXtkf-12D3KooWGBzFUDEw14UtJg1MeYrN5b8UNnyNBgqjumrB9p3wfqQ7-1616743172515884002  Completed       false     
2021-03-26T13:26:26+05:30  bafyreib4yuxx6jmtjonlfdvpi3wk7vmvtvhi6d6teo2qhqscpkznt7gvbq  13      f01000    StorageDealActive    Y (epoch 1628)  N         baga6ea4seaqkmjd7eh6ypntkvtnfp65fjgqhhta44vik7ths7hkrrp32scruujy  1.984 KiB  0.000402271796572128 FIL  1300964   12D3KooWHxkZnb2UHS23QAE6Hs2GptYQpziQXaHwpHjnZGHdXtkf-12D3KooWGBzFUDEw14UtJg1MeYrN5b8UNnyNBgqjumrB9p3wfqQ7-1616743172515884004  Completed       false     
2021-03-26T13:26:31+05:30  bafyreibj47awsvzkblc4r6xln7elgh5r6gr4ftbvqo67i3sbjyfhk75mr4  14      f01000    StorageDealAwaitingPreCommit  Y (epoch 1630)  N         baga6ea4seaqkmjd7eh6ypntkvtnfp65fjgqhhta44vik7ths7hkrrp32scruujy  1.984 KiB  0.000402271487361576 FIL  1300963   12D3KooWHxkZnb2UHS23QAE6Hs2GptYQpziQXaHwpHjnZGHdXtkf-12D3KooWGBzFUDEw14UtJg1MeYrN5b8UNnyNBgqjumrB9p3wfqQ7-1616743172515884005  Completed       false     
2021-03-26T13:26:34+05:30  bafyreignj7x7smarnhd7ndbgrsi6xtwwnanxndhtww7fsc2tadnnrwnhru  12      f01000    StorageDealAwaitingPreCommit  Y (epoch 1630)  N         baga6ea4seaqkmjd7eh6ypntkvtnfp65fjgqhhta44vik7ths7hkrrp32scruujy  1.984 KiB  0.000402271178151024 FIL  1300962   12D3KooWHxkZnb2UHS23QAE6Hs2GptYQpziQXaHwpHjnZGHdXtkf-12D3KooWGBzFUDEw14UtJg1MeYrN5b8UNnyNBgqjumrB9p3wfqQ7-1616743172515884003  Completed       false 

Just show the first two deals

aarshshah@Aarshs-MacBook-Pro lotus % lotus client list-deals -v --limit=2

Created                    DealCid                                                      DealId  Provider  State                         On Chain?       Slashed?  PieceCID                                                          Size       Price                     Duration  TransferChannelID                                                                                                              TransferStatus  Verified  Message
2021-03-26T13:24:26+05:30  bafyreibcacybtma7rdfycjkognrl6wdty3lkmrdvys4jtoqbiwi2uziuaa  10      f01000    StorageDealAwaitingPreCommit  Y (epoch 1629)  N         baga6ea4seaqkmjd7eh6ypntkvtnfp65fjgqhhta44vik7ths7hkrrp32scruujy  1.984 KiB  0.000402281072888688 FIL  1300994   12D3KooWHxkZnb2UHS23QAE6Hs2GptYQpziQXaHwpHjnZGHdXtkf-12D3KooWGBzFUDEw14UtJg1MeYrN5b8UNnyNBgqjumrB9p3wfqQ7-1616743172515884001  Completed       false     
2021-03-26T13:26:21+05:30  bafyreic33ishws3swia2j4wwajlavv7ullpii237pqygtm4o4fwttsdayu  11      f01000    StorageDealAwaitingPreCommit  Y (epoch 1630)  N         baga6ea4seaqkmjd7eh6ypntkvtnfp65fjgqhhta44vik7ths7hkrrp32scruujy  1.984 KiB  0.00040227210578268 FIL   1300965   12D3KooWHxkZnb2UHS23QAE6Hs2GptYQpziQXaHwpHjnZGHdXtkf-12D3KooWGBzFUDEw14UtJg1MeYrN5b8UNnyNBgqjumrB9p3wfqQ7-1616743172515884002  Completed       false     

Show deals after a certain time offset

aarshshah@Aarshs-MacBook-Pro lotus % lotus client list-deals --creation-time-offset="2021-03-26T13:26:21+05:30"
DealCid      DealId  Provider  State                         On Chain?       Slashed?  PieceCID     Size       Price                     Duration  Verified  
...wttsdayu  11      f01000    StorageDealAwaitingPreCommit  Y (epoch 1630)  N         ...2scruujy  1.984 KiB  0.00040227210578268 FIL   1300965   false     
...znt7gvbq  13      f01000    StorageDealActive             Y (epoch 1628)  N         ...2scruujy  1.984 KiB  0.000402271796572128 FIL  1300964   false     
...fhk75mr4  14      f01000    StorageDealAwaitingPreCommit  Y (epoch 1630)  N         ...2scruujy  1.984 KiB  0.000402271487361576 FIL  1300963   false     
...nnrwnhru  12      f01000    StorageDealAwaitingPreCommit  Y (epoch 1630)  N         ...2scruujy  1.984 KiB  0.000402271178151024 FIL  1300962   false

Show the first two deals after a certain time offset

aarshshah@Aarshs-MacBook-Pro lotus % lotus client list-deals --creation-time-offset="2021-03-26T13:26:21+05:30" --limit=2
DealCid      DealId  Provider  State                         On Chain?       Slashed?  PieceCID     Size       Price                     Duration  Verified  
...wttsdayu  11      f01000    StorageDealAwaitingPreCommit  Y (epoch 1630)  N         ...2scruujy  1.984 KiB  0.00040227210578268 FIL   1300965   false     
...znt7gvbq  13      f01000    StorageDealActive             Y (epoch 1628)  N         ...2scruujy  1.984 KiB  0.000402271796572128 FIL  1300964   false   

cli/client.go Show resolved Hide resolved
Copy link
Contributor

@dirkmc dirkmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

Base automatically changed from feat/markets-v1.2.0 to master March 31, 2021 16:59
@dirkmc dirkmc mentioned this pull request Apr 2, 2021
4 tasks
@magik6k magik6k added the team/ignite Issues and PRs being tracked by Team Ignite at Protocol Labs label Jun 3, 2021
@raulk raulk removed the team/ignite Issues and PRs being tracked by Team Ignite at Protocol Labs label Jun 8, 2021
@magik6k magik6k marked this pull request as draft June 8, 2021 14:19
@Kubuxu Kubuxu closed this Nov 25, 2021
@Kubuxu Kubuxu deleted the feat/paginate-deals branch November 25, 2021 19:00
@Kubuxu Kubuxu restored the feat/paginate-deals branch November 25, 2021 19:07
@Kubuxu Kubuxu reopened this Nov 25, 2021
@magik6k
Copy link
Contributor

magik6k commented Nov 22, 2023

Built in markets are now deprecated in lotus, this feature won't land

@magik6k magik6k closed this Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants