-
Notifications
You must be signed in to change notification settings - Fork 107
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
Storing data on the network not possible with helia in the browser? #159
Comments
helia_.html ->helia_.zip |
Seems to be the same issue as #138 |
referenced this issue on the ipfs forum |
Thanks for submitting this issue @AlexCherrypi I briefly looked into it and was able to reproduce this issue. I feel I know the cause of why this might be happening, but would like to test a few things out before I post my findings. I think this will be a good candidate for a an example. In the mean time I think @achingbrain's input could be valuable here. |
@eccker This is exactly what I discovered as well. It seems to be a problem with helia, not ipfs in the browser in general |
@AlexCherrypi Yes, but maybe there are new security policies applied to browsers, just tried a project used last year working fine with js-ipfs on chrome (don't remember version) and now both helia and js-ipfs got me a security phishing warning on Chrome Versión 114.0.5735.134 (Build oficial) (64 bits) |
These are failed dial attempts to peers, which is to be expected. No one should expect to be able to connect to every peer in the network.
@eccker js-ipfs uses preload nodes which are being deprecated and helps to ensure the network (specifically, nodes that are probably very close to ipfs gateway nodes) is populated with the CID content you've added to your node. "In practice, [...] js-ipfs clients can add some content locally, then use a preload node to request that CID, effectively caching the data and allowing the browser tab to be closed without the data instantly becoming unavailable." Helia does not use preload nodes, but Helia can be ran in a service-worker. That means your node can continue running in the browser even after a tab closes (there are caveats & exceptions here) In order to debug the access of your content, you should use https://pl-diagnose.on.fleek.co/#/diagnose/access-content. When I use this tool, and helia, I can see that new content and CIDs I create in my browser node are "on the DHT", and that the PeerID of my browser node are providing this content. Providing content from a browser node will be slow until webrtc/webtransport and other browser-compatible transports become more ubiquitous. See my answer at https://discuss.ipfs.tech/t/how-to-retrieve-content-uploaded-via-helia-using-the-ipfs-gateway/16582/4?u=sgtpooki and let's continue discussion there. |
@SgtPooki thank you very much for your amazing response. Is there any example of service-worker?
yeah! It's what i though |
The only example of a service worker with Helia at the moment is https://github.com/ipfs-shipyard/helia-service-worker-gateway, which is more than just Helia as a service-worker.. it's a POC for Helia-as-a-service-worker operating as a local in-browser IPFS gateway. I'm going to close this issue, because I think the discussion for the issues you were running into are better held at https://discuss.ipfs.tech/t/how-to-retrieve-content-uploaded-via-helia-using-the-ipfs-gateway/16582/4?u=sgtpooki. If you're interested in following our implementation of an example where we show how to host/provide content from Helia (in and out of the browser) then please follow ipfs-examples/helia-examples#39 |
This should be a dep not a dev dep. Refs #158
## [@helia/ipns-v4.0.0](https://github.com/ipfs/helia-ipns/compare/@helia/ipns-v3.0.1...@helia/ipns-v4.0.0) (2024-01-08) ### ⚠ BREAKING CHANGES * uses multiformats v13 and helia v3, renames `dht` routing to `libp2p` ### Features * update helia to v3 and multiformats to v13 ([#167](ipfs/helia-ipns#167)) ([a0381b9](ipfs/helia-ipns@a0381b9)) ### Bug Fixes * make @libp2p/interface a dependency ([#159](ipfs/helia-ipns#159)) ([546ecf0](ipfs/helia-ipns@546ecf0)), closes [#158](ipfs/helia-ipns#158)
I was trying to get some sort of "hello world" project going in helia.
Retrieving data is no issue, but storing my own does not seem to work.
This is my test file: helia_.html
looking for the file on https://ipfs.io/ipfs/CID or trying to get the data via cid in another ipfs client does not work.
The text was updated successfully, but these errors were encountered: