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

docs: add-content #7

Merged
merged 25 commits into from
Nov 13, 2023
Merged

docs: add-content #7

merged 25 commits into from
Nov 13, 2023

Conversation

heyjay44
Copy link
Contributor

No description provided.

@vasco-santos vasco-santos changed the title docs/add-content docs: add-content Nov 13, 2023
@vasco-santos vasco-santos changed the base branch from main to docs November 13, 2023 09:23
Base automatically changed from docs to main November 13, 2023 09:29
Copy link
Contributor

github-actions bot commented Nov 13, 2023

Comment on lines 3 to 4
Possible architectures of using web3.storage to upload

Copy link
Contributor

Choose a reason for hiding this comment

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

I would take this out

Suggested change
Possible architectures of using web3.storage to upload

Copy link
Contributor

Choose a reason for hiding this comment

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

seems redundant

@@ -0,0 +1,138 @@
# Architecture options
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Architecture options
# Architecture

src/pages/docs/concepts/architecture-options.md Outdated Show resolved Hide resolved

- Client-server: You (the developer) own the Space, and your user uploads to your backend infra before you upload it to the service
- Delegated: You own the Space, but you give a delegated UCAN token to your user's Agent to upload directly to the service (rather than needing to touch the upload in your backend)
- (Most complex) User-owned: Your user owns the Space and registers it and they use it to upload directly with the service; if you want to instrument visibility into what they're uploading, you'll have to write separate code in your app for it
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- (Most complex) User-owned: Your user owns the Space and registers it and they use it to upload directly with the service; if you want to instrument visibility into what they're uploading, you'll have to write separate code in your app for it
- (Most complex) User-owned: User owns the Space and registers it. They use it to upload directly with the service

They won't pay for the storage, and it depends on the capabilities the service will have. I would leave these details out

- Your user does not need a registered Space - just an Agent with a delegation from your Space
- w3up-client in the end user environment should have a unique Agent for each user, which should happen by default (since when w3up-client is instantiated it creates a new Agent anyway, or uses the one in local Store)
- From there, when your end user is ready to upload, they should request from your backend a delegation from your developer-owned Space to their Agent (which can be derived via [client.agent()](https://github.com/web3-storage/w3up/blob/main/packages/w3up-client/docs-Client#agent))
- In your backend, you can call [client.createDelegation()](https://github.com/web3-storage/w3up/blob/main/packages/w3up-client/docs-Client#createDelegation) passing in the Agent object from client.agent() in your end user's instance, and passing through options? params to limit the scope of the delegation (e.g., store/add, upload/add, expiration time)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should clearly mention that we do not recommend delegation with wildcard and only for what is strictly needed

- You can serialize this using delegation.archive() and send it to your user
- The end user instance of the client should not need to call client.authorize(email), as it is not claiming any delegations via email address (but rather getting the delegation directly from your backend)
- Once your user receives the delegation, they can deserialize it using [ucanto.Delegation.extract()](https://github.com/web3-storage/ucanto/blob/c8999a59852b61549d163532a83bac62290b629d/packages/core/src/delegation.js#L399) and pass it in using client.addSpace(), and from there they can run any of the upload methods
- Note that this alone does not give visibility into which of your end users are uploading what; to track this, you'll probably need them to send you that information separately (e.g., once they've run upload and get back a content CID, you can have them send that CID to you for tracking)
Copy link
Contributor

Choose a reason for hiding this comment

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

there is also the option to create a space per user under your "account"? Which I actually would be expecting to read

Copy link
Contributor

Choose a reason for hiding this comment

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

tracking as a separate request does not look so functional as an user can easily workaround this and use the delegation "off record" in the frontend

Copy link
Contributor

Choose a reason for hiding this comment

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

plz open an issue or PR for this?

src/pages/docs/concepts/architecture-options.md Outdated Show resolved Hide resolved
src/pages/docs/concepts/content-addressing.md Outdated Show resolved Hide resolved
src/pages/docs/concepts/car.md Outdated Show resolved Hide resolved

Working with Content Archives (CAR) files

When you upload files to web3.storage using the [client library](https://web3.storage/docs/reference/js-client-library/), your data is converted into a graph of data structures, which are then packed into a format called a Content Archive (CAR) before being sent to the web3.storage service.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be a local link?

src/pages/docs/concepts/car.md Outdated Show resolved Hide resolved
src/pages/docs/concepts/car.md Outdated Show resolved Hide resolved
src/pages/docs/concepts/car.md Outdated Show resolved Hide resolved
src/pages/docs/concepts/car.md Outdated Show resolved Hide resolved

The [ipfs-car](https://github.com/web3-storage/ipfs-car) JavaScript package includes a command-line tool for easily creating, unpacking, and verifying CAR files.

To install it, you'll need [Node.js](https://nodejs.org/) - we recommend the latest stable version.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would honestly get all these details out. They already are in the repo readme and when changed we need to bubble up these changes everywhere

License: MIT
Signed-off-by: Oli Evans <[email protected]>
License: MIT
Signed-off-by: Oli Evans <[email protected]>
License: MIT
Signed-off-by: Oli Evans <[email protected]>
License: MIT
Signed-off-by: Oli Evans <[email protected]>
License: MIT
Signed-off-by: Oli Evans <[email protected]>
olizilla and others added 2 commits November 13, 2023 14:55
License: MIT
Signed-off-by: Oli Evans <[email protected]>
@olizilla
Copy link
Contributor

This PR now implements most of the content and navbar layout that was proposed in https://docs.google.com/document/d/1Y280tgNbrdb_MalxEFXpjm11SBBT2SdJwMPD6sqmm4s/edit#heading=h.7x0qpln8js0o

The content needs refining, and some pages need completing, but I have normalised what we have so it's coherent, so other folks can jump in and build on it

Screenshot 2023-11-13 at 15 06 16

@olizilla olizilla merged commit 4ae0936 into main Nov 13, 2023
5 checks passed
@olizilla olizilla deleted the add-markdown branch November 13, 2023 15:13
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.

4 participants