-
Notifications
You must be signed in to change notification settings - Fork 21
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!: allow invocation configuration to be generated on demand #1507
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alanshaw
changed the title
feat: allow invocation configuration to be generated on demand
feat!: allow invocation configuration to be generated on demand
Jun 17, 2024
vasco-santos
approved these changes
Jun 17, 2024
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, I am curious if there is other option explored with the client refactor we can consider.
Worth adding docs for this to the readme, maybe with an example
This was referenced Jun 13, 2024
alanshaw
pushed a commit
that referenced
this pull request
Jun 19, 2024
🤖 I have created a release *beep* *boop* --- ## [17.0.0](upload-client-v16.1.1...upload-client-v17.0.0) (2024-06-19) ### ⚠ BREAKING CHANGES * allow invocation configuration to be generated on demand ([#1507](#1507)) ### Features * allow invocation configuration to be generated on demand ([#1507](#1507)) ([fd74cbb](fd74cbb)) * configure UnixFS encoder ([#1509](#1509)) ([1a5e648](1a5e648)) ### Fixes * stop writing to DUDEWHERE ([#1500](#1500)) ([cf0a1d6](cf0a1d6)) --- 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: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
alanshaw
pushed a commit
that referenced
this pull request
Jul 29, 2024
🤖 I have created a release *beep* *boop* --- ## [16.0.0](w3up-client-v15.0.0...w3up-client-v16.0.0) (2024-07-29) ### ⚠ BREAKING CHANGES * allow invocation configuration to be generated on demand ([#1507](#1507)) ### Features * allow invocation configuration to be generated on demand ([#1507](#1507)) ([fd74cbb](fd74cbb)) * configure UnixFS encoder ([#1509](#1509)) ([1a5e648](1a5e648)) ### Fixes * badgers on README ([ffe49f2](ffe49f2)) --- 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: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since the blob protocol landed, it's become harder to obtain a delegation to upload a specific CAR.
It was tricky before because of sharding, but assuming you created a CAR below the shard threshold, its easy enough to obtain a
store/add
delegation tied to the CAR CID.With the blob protocol, we now generate an index, and
blob/add
that as well. It means we can't just create a CAR and delegatecan: blob/add, nb: { link, size }
for the CAR, because we also need to delegateblob/add
for the index, but we don't know the index CID or it's size up front...It's ok if the delegation is not restricted to the specific CAR, but for certain use cases it's necessary to delegate just what is needed.
This PR alters the client to allow invocation configuration to be generated on demand, when the proofs are required. This is a backwards compatible change.
So, for example instead of calling:
uploadFile({ issuer, with, proofs }, file)
you now call:...and
configure
will be called for each proof that is needed (blob/add
,index/add
andupload/add
).It means also that we no longer have to recommend folks to create a CAR, get the CID and then upload it, they can just use
uploadFile
and pass in the invocation config function to obtain the correct delegations when required.