-
Notifications
You must be signed in to change notification settings - Fork 54
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
consider adding toURL
method to embed best practices of serializing cid to URL
#71
Comments
This sounds sensible, but you may want to update example to use generic path gateway: - * cid.toURL().href // 'https://bafybeigizayotjo4whdurcq6ge7nrgfyxox7ji7oviesmnvgrnxn3nakni.ipfs.dweb.link/'
+ * cid.toURL(new URL('https://dweb.link')).href // 'https://dweb.link/ipfs/bafybeigizayotjo4whdurcq6ge7nrgfyxox7ji7oviesmnvgrnxn3nakni'
|
I'm not sure about it. To me CID is a concept that is independent of IPFS. Hence I would rather put IPFS-style URL generation into a higher level library. Please consider this comment an opinion and not something blocking this effort. |
@vmx, perhaps one of the options could be |
There is an ongoing effort to try and reframe "IPFS" to be something other than the go-ipfs and js-ipfs instantiations and decouple it from the current 'IPFS DHT'. It goes something like this (iterating on language from Juan): IPFS is:
Which then encompasses go-ipfs, js-ipfs, the 'IPFS DHT' gateways, Filecoin and any other stack that uses CIDs to form DAGs with some form of ~p2p. So when viewed in that lens, this change kind of makes sense landing here. It shouldn't be viewed as "this thing can be fetched from an IPFS gateway because it's in 'the IPFS DHT'". Rather, it should mean "this is an IPFS-style link to something, it can be found in the IPFS stack, but you may need further context to actually locate the block." |
There had been various discussions about the fact that in the wild we see IPFS urls to specific gateways. I think we can bake a best practice into CID implementation by adding a method like:
Note that here we reinforce several of the best practices:
ipfs://${cidv1}
is the default that we to see.Gateways URLs are origin separated.The text was updated successfully, but these errors were encountered: