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

feat: #6017 market: retrieval ask CLI command #7814

Merged
merged 4 commits into from
Dec 20, 2021
Merged

Conversation

dirkmc
Copy link
Contributor

@dirkmc dirkmc commented Dec 17, 2021

Related Issues

Fixes #6017
Supersedes #7397

Proposed Changes

Add CLI command for retrieval asks

Example Output

$ lotus client query-retrieval-ask --size=134217728 f01000 bafyaeicumxtb5zs3fnli2yndp4iakfit64jdxp7ulajv1lkw2cyiwi3pvm
Ask: f01000
Unseal price: 0.000000001 FIL
Price per byte: 0.000000002 FIL
Payment interval: 1 MiB
Payment interval increase: 2 MiB
Total price for 134217728 bytes: 0.268435457 FIL

@codecov
Copy link

codecov bot commented Dec 17, 2021

Codecov Report

Merging #7814 (0e53275) into master (a4728d3) will increase coverage by 0.00%.
The diff coverage is 58.97%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7814   +/-   ##
=======================================
  Coverage   39.47%   39.48%           
=======================================
  Files         654      654           
  Lines       70033    70071   +38     
=======================================
+ Hits        27649    27670   +21     
- Misses      37633    37643   +10     
- Partials     4751     4758    +7     
Impacted Files Coverage Δ
api/api_full.go 47.36% <ø> (ø)
cli/client.go 22.11% <52.94%> (+0.80%) ⬆️
itests/kit/client.go 87.50% <100.00%> (+0.48%) ⬆️
node/impl/client/client.go 51.31% <100.00%> (+0.77%) ⬆️
markets/loggers/loggers.go 89.28% <0.00%> (-10.72%) ⬇️
chain/actors/builtin/miner/diff.go 48.52% <0.00%> (-10.30%) ⬇️
markets/retrievaladapter/client_blockstore.go 62.50% <0.00%> (-6.25%) ⬇️
storage/wdpost_sched.go 75.49% <0.00%> (-5.89%) ⬇️
chain/exchange/peer_tracker.go 66.66% <0.00%> (-4.31%) ⬇️
chain/vm/mkactor.go 48.48% <0.00%> (-3.04%) ⬇️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4728d3...0e53275. Read the comment docs.

@dirkmc dirkmc marked this pull request as ready for review December 17, 2021 15:05
@dirkmc dirkmc requested a review from a team as a code owner December 17, 2021 15:05
@jennijuju jennijuju added this to the v1.13.3 milestone Dec 17, 2021
cli/client.go Outdated Show resolved Hide resolved
cli/client.go Outdated
afmt.Printf("Payment interval: %s\n", types.SizeStr(types.NewInt(ask.PaymentInterval)))
afmt.Printf("Payment interval increase: %s\n", types.SizeStr(types.NewInt(ask.PaymentIntervalIncrease)))

size := cctx.Int64("size")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure that QueryOffer has a Size field (for the whole piece, so doesn't exactly apply to selective retrievals, but imo still useful to print that)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The size is actually passed in as a parameter - if the user passes it, then the "Total Cost" calculation is output - see the Example Output in the PR description.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, my point is that the default could be to use the size from QueryOffer if it wasn't specified by the user

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok I made that change 👍

Copy link
Member

@nonsense nonsense left a comment

Choose a reason for hiding this comment

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

lgtm

@magik6k magik6k merged commit ef65ddf into master Dec 20, 2021
@magik6k magik6k deleted the feat/retrieval-ask-cli branch December 20, 2021 17:04
@jennijuju jennijuju modified the milestones: v1.13.3, v1.15.0 Jan 2, 2022
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.

[Feature Request] Add a command for query retrieval price of miners
4 participants