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

example: create and host IPFS content from helia node (browser & nodejs) #39

Open
SgtPooki opened this issue Apr 6, 2023 · 7 comments

Comments

@SgtPooki
Copy link
Contributor

SgtPooki commented Apr 6, 2023

Not sure what the blockers are, but after a post in slack, I wanted to make sure we had an item tracking creating an example for this, and any blockers.

@achingbrain
Copy link
Contributor

For people without slack, or for after slack deletes the message, this is what it said:

Was able to get Helia working, and it uploads my file, but I'm not able to see it on the public gateways? How do I publish to ipns or get it to be seen on the public gateways?

Connecting to 12D3Foo...
Adding file image-581431514258.jpg...
Added to bafyfoo

@achingbrain
Copy link
Contributor

achingbrain commented Apr 7, 2023

The need for an IPNS example is mentioned here: ipfs/helia#43

The esbuild demo generates a link you can click to load content you just added to your local node from the public gateway.

It's going to be hard from the browser because you either have to:

  1. Be trying to load content from a gateway that your demo browser node already has a direct connection to (e.g. for bitswap to do it's thing)
  2. Be externally diallable by the gateway. Adding the block will cause a provider record to be published to third party nodes that points to your browser node. The gateway needs to be able to resolve that provider record, then dial your node for bitswap to kick in.

--

  1. is luck of the draw since the gateways have round-robin DNS
  2. will become more workable when the private-to-private webrtc transport arrives

@achingbrain
Copy link
Contributor

Maybe a dupe of #38 ?

@aschmahmann
Copy link

IIUC 2 should also be doable even without the private-to-private webrtc transport.

For example: if a publicly reachable node (e.g. the kubo nodes currently running behind dweb.link) tries to fetch content from a browser and that browser node is connected to some relays the publicly reachable node can ask the browser to dial them back using WSS, WebTransport or browser-to-server webrtc

Obviously private-to-private webrtc gives more connectivity in more environments which is 👍. It's also unintuitive for people to think that making themselves publicly accessible will result in them being able to retrieve more content, although it happens to be good for the network overall for more nodes to be publicly accessible so not such a bad result 🙃.

@maceip
Copy link

maceip commented Jun 6, 2023

can we get an ipfs funded circuitRelayServer to bootstrap browser-browser webrtc -> ipfs (and/or do other public relays exist?).

I think an example of helia with autonat + circuitrelay using an ipfs-hosted bootstrap /webrtc/ multiaddr would increase new dev velocity ( I just went down this rabbit hole)

@SgtPooki
Copy link
Contributor Author

AFAIK, this is fully unblocked, we just need to write up the example.

@SgtPooki
Copy link
Contributor Author

FYI: I posted a reply to the discuss.ipfs.tech post regarding fetching content from a helia node.

See https://discuss.ipfs.tech/t/how-to-retrieve-content-uploaded-via-helia-using-the-ipfs-gateway/16582/6?u=sgtpooki.

Please let me know if anyone tries it out and runs into issues.

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

No branches or pull requests

4 participants