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: Server cost model #20

Closed
hopeyen opened this issue Dec 5, 2023 · 1 comment
Closed

Feat: Server cost model #20

hopeyen opened this issue Dec 5, 2023 · 1 comment
Assignees
Labels
p1 High priority size:medium Medium
Milestone

Comments

@hopeyen
Copy link
Collaborator

hopeyen commented Dec 5, 2023

To add price matching in subfile exchanges,

  1. Start with adding a CLI config --price-per-byte to ServerArgs.
    The price is not stored in a database or subfile-specific at the moment. There may be a case where the bytes in a subfile is more valuable than another, then we can consider a more complex management.

  2. Add a /cost endpoint that returns the price per byte for client/third-party price matching

  3. When receiving paid queries, parse for receipts and condition on the receipt value where $\text{price per byte} * \text{bytes range} \leq \text{receipt value}$

  4. Add a admin/cost endpoint for adjusting price_per_byte on the fly, taking a method set_price and a param price_per_byte to replace the previous price.

Additionally consider if indexer_framework can take care of cost models

@hopeyen hopeyen added type:enhancement size:large Large p2 Medium priority labels Dec 5, 2023
@hopeyen hopeyen added this to the MVP milestone Dec 5, 2023
@hopeyen hopeyen changed the title [Feat] Server cost model Feat: Server cost model Dec 5, 2023
@hopeyen hopeyen mentioned this issue Dec 5, 2023
33 tasks
@hopeyen hopeyen added p1 High priority and removed p2 Medium priority labels Dec 12, 2023
@hopeyen
Copy link
Collaborator Author

hopeyen commented Dec 12, 2023

Done 1,2,4 in 650b741
3 left for future when receipt is constructed

@hopeyen hopeyen closed this as completed Dec 12, 2023
@hopeyen hopeyen self-assigned this Dec 12, 2023
@hopeyen hopeyen added size:medium Medium and removed size:large Large labels Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1 High priority size:medium Medium
Projects
None yet
Development

No branches or pull requests

1 participant