-
Notifications
You must be signed in to change notification settings - Fork 69
Add 102 tutorial for CID generation configurations and CID profiles #455
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
base: main
Are you sure you want to change the base?
Add 102 tutorial for CID generation configurations and CID profiles #455
Conversation
examples/helia-101/package.json
Outdated
"ipfs-unixfs": "^11.2.0", | ||
"ipfs-unixfs-exporter": "^13.6.1", | ||
"ipfs-unixfs-importer": "^15.3.1", | ||
"libp2p": "^2.1.6", |
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.
No need to add libp2p and exporter explicitly
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.
Sorry. This is my bad. libp2p was already in here because we import it directly in the 301 example.
const bigHtmlFile = createReadStream('./2600-h.htm') | ||
|
||
// generate CID according to Helia defaults (~== kubo v1 profile) from bigHtmlFile: | ||
const cidBigHTML = await fs.addFile( |
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.
You can simplify this by having helia download the file for you as I did in
const urlCid = await fs.addFile(urlSource(url)) |
https://github.com/ipfs-examples/helia-examples/pull/456/files#diff-15db2a7c59c6093dbf74da5c6c0132ad792799c35a93eabe589cf6cd00d1019dR65
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.
i thought having a local file would simplify the comparison to kubo, since i don't think the latter has a "from URL" option? this is neat, tho, maybe it makes sense to add it as a 5th example before the local-file version to show that it's the same CID between urlSource(url)
and the local file curled from the same URL... i leave it to the tutorials' editor to decide!
Co-authored-by: Daniel Norman <[email protected]>
Co-authored-by: Daniel Norman <[email protected]>
Co-authored-by: Daniel Norman <[email protected]>
(I'll incorporate the changes above before un-drafting, if i ever do!) |
No strong opinions on whether they gets merged into #465 or otherwise reworked stylistically, I just want there to be a stable github URL i can send people when they ask how to get the equivalent determinism of the kubo profiles in helia! |
Thanks to @achingbrain and @2color for getting me started on this!