-
Notifications
You must be signed in to change notification settings - Fork 22
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: w3 aggregate protocol client and api implementation #787
Conversation
6b78e8d
to
319bf4b
Compare
Upgrades ucanto to 8. There are no breaking changes that affect normal functionality as expected
269f9fc
to
83b0ed3
Compare
5bfcb09
to
372c2f3
Compare
b0dcbb1
to
30d6d60
Compare
While writing this and getting to know more about
|
@@ -95,6 +95,7 @@ | |||
}, | |||
"rules": { | |||
"unicorn/prefer-number-properties": "off", | |||
"unicorn/expiring-todo-comments": "off", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lint fails with TODO: ...
comments now ...
A few follow ups will be worked on:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a minor non blocking consistency thing on the failures...
|
||
class AggregateNotFound extends Server.Failure { | ||
get name() { | ||
return /** @type {const} */ ('AggregateGetFailure') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return /** @type {const} */ ('AggregateGetFailure') | |
return /** @type {const} */ ('AggregateNotFoundFailure') |
get name() { | ||
return /** @type {const} */ ('AggregateOfferInvalidUrlFailure') | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell most of the time we don't suffix with Error
or Failure
, e.g.
https://github.com/web3-storage/w3up/blob/57182b1d193924a6c5eefa3e01ef56719303c42e/packages/capabilities/src/types.ts#L47-L49
https://github.com/web3-storage/w3up/blob/57182b1d193924a6c5eefa3e01ef56719303c42e/packages/upload-api/src/types.ts#L236C14-L238
Perhaps be consistent with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
🤖 I have created a release *beep* *boop* --- ## [6.0.0](capabilities-v5.0.1...capabilities-v6.0.0) (2023-06-07) ### ⚠ BREAKING CHANGES * merge `@web3-storage/access-api` into `@web3-storage/upload-api` ([#790](#790)) ### Features * merge `@web3-storage/access-api` into `@web3-storage/upload-api` ([#790](#790)) ([4f6ddb6](4f6ddb6)) * w3 aggregate protocol client and api implementation ([#787](#787)) ([b58069d](b58069d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [14.0.0](access-v13.0.2...access-v14.0.0) (2023-06-07) ### ⚠ BREAKING CHANGES * merge `@web3-storage/access-api` into `@web3-storage/upload-api` ([#790](#790)) ### Features * merge `@web3-storage/access-api` into `@web3-storage/upload-api` ([#790](#790)) ([4f6ddb6](4f6ddb6)) * w3 aggregate protocol client and api implementation ([#787](#787)) ([b58069d](b58069d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: Travis Vachon <travis.vachon@protocol.ai>
🤖 I have created a release *beep* *boop* --- ## [7.0.0](w3up-client-v6.0.1...w3up-client-v7.0.0) (2023-06-08) ### ⚠ BREAKING CHANGES * merge `@web3-storage/access-api` into `@web3-storage/upload-api` ([#790](#790)) ### Features * merge `@web3-storage/access-api` into `@web3-storage/upload-api` ([#790](#790)) ([4f6ddb6](4f6ddb6)) * w3 aggregate protocol client and api implementation ([#787](#787)) ([b58069d](b58069d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: Travis Vachon <travis.vachon@protocol.ai>
Previous PR went out without workflows commited #787 🤦🏼♂️ --------- Co-authored-by: Travis Vachon <travis.vachon@protocol.ai> Co-authored-by: Travis Vachon <travis.vachon@gmail.com>
🤖 I have created a release *beep* *boop* --- ## [9.1.0](upload-client-v9.0.1...upload-client-v9.1.0) (2023-06-20) ### Features * w3 aggregate protocol client and api implementation ([#787](#787)) ([b58069d](b58069d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: Travis Vachon <travis.vachon@protocol.ai>
Context storacha/w3up#787 (comment) --------- Co-authored-by: Irakli Gozalishvili <contact@gozala.io>
🤖 I have created a release *beep* *boop* --- ## 1.0.0 (2023-07-11) ### ⚠ BREAKING CHANGES * aggregate capabilities now have different nb properties and aggregate client api was simplified ### Features * w3 aggregate protocol client and api implementation ([#787](#787)) ([b58069d](b58069d)) ### Bug Fixes * update aggregate spec in client and api ([#824](#824)) ([ebefd88](ebefd88)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## 1.0.0 (2023-07-11) ### ⚠ BREAKING CHANGES * aggregate capabilities now have different nb properties and aggregate client api was simplified ### Features * w3 aggregate protocol client and api implementation ([#787](#787)) ([b58069d](b58069d)) ### Bug Fixes * aggregate api test link comparison type ([#816](#816)) ([81bdf1c](81bdf1c)) * update aggregate spec in client and api ([#824](#824)) ([ebefd88](ebefd88)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: Vasco Santos <santos.vasco10@gmail.com>
This PR is a first iteration for w3 aggregate client and API implementations. It follows same patterns we identified while working on
upload-api
andupload-client
and is agnostic from the deployment service.aggregate-api
exposes a lib and a set of tests that implementers with infra should follow, as well as the needed interfaces that must be fulfilled. It also includesfx
usage foraggregate/offer
return valueIt follows spec https://github.com/web3-storage/specs/blob/feat/filecoin-spec/w3-aggregation.md
There are two interfaces defined in this service:
offerStore
- responsible for receiving offers to be queued. Implementer receivescommD
of aggregate together with Offer content. These will be used to give SPs. Note that implementer should keep track of the offer'scommD
so that it can query over time when a deal is done (or failures), so that thefx
invocation can be executed and a receipt generatedaggregateStore
- store of aggregates already places with SPs (implementor likespade-proxy
will have this store hooked with spade DB)It is worth noting that this is a first iteration and not the complete thing at this moment. More specifically, in follow up iterations we need to:
commitmentProof
aggregate-api should validate commD #805aggregateGet
types are still unknown at this moment aggregate-apiaggregate/get
set types #807New detailed issues for above will be created before this PR gets merged.
Part of storacha/w3filecoin-infra#19
Still to do:
Usage:
aggregate-api
- feat: add ucanto aggregation api service web3-storage/dealer#2aggregate-client
- feat: integrate aggregation client w3filecoin-infra#22Closes #772 and #773