A node reference implementation to publish website through IPFS gateway

Hi, is there a reference implementation using js-libp2p with Helia and friends to publish a website through an IPFS gateway from a desktop/laptop behind consumer internet (NAT/UPNP/PMP/etc)?

From first looks, many parts are there, but they don’t seem fully tested or working together for a desktop p2p app - similar to bittorrent clients

I only have my networking config, and it’s taken a lot of fussing to get it to work. But I want to build things I’m confident work on everyone’s networking config.

I’m thinking about features in bittorrent clients:

  • change ports at runtime
  • configure and detect UPNP/PMP/NAT

Bundled as a proof of concept for publishing a static website through an ipfs gateway.

If I had to start from scratch, I’d build it like this:

  • Node and Typescript using Vite
  • A one-page web UI
  • An Express server with access to the libp2p stack
  • A REST API because it’s easy for web devs to reason about
    • POST /publish - Publish local folder → get CID → html makes link to gateway
    • GET /publish - list of published folders
    • GET /status - to poll for network status
    • GET/POST /config - change networking (ports, enable/disable features, etc)
  • Logging and status so it’s easy to reason about bugs and features

@danieln and @bumblefudge what do you think?

@dhuseby can you think of a “just add water” way to deliver the torrent-style NAT-circumvention outlined in this post? or an exemplary js-libp2p config on github that could be turned into a tutorial or made part of a “just add water” tutorial/example project of the kind being proposed? apologies for having to tag you in and not just tracking your own tutorial/example project repo progress passively.

Hi bumblefudge, thanks for the reply. I’m totally willing to be wrong about it, but it looks like the current AutoNAT and uPnP modules can’t do this OOTB:

It’s also discussed a bit here:

To get an idea of what users expect, here are some reference images of bittorrent configs:



Imgur: The magic of the Internet - 10 years old