libp2p / js-libp2p

The JavaScript Implementation of libp2p networking stack.
https://libp2p.github.io/js-libp2p/
Other
2.34k stars 446 forks source link

libp2p http transport example #2312

Open SgtPooki opened 11 months ago

SgtPooki commented 11 months ago

We should validate that we can utilize js-libp2p to fetch content from another libp2p node that supports an IPFS gateway over libp2p.

see https://github.com/ipfs/kubo/blob/master/docs/experimental-features.md#http-gateway-over-libp2p for more details.

  1. set up a kubo node and enable the http-gateway-over-libp2p experiment: ipfs config --json Experimental.GatewayOverLibp2p true
  2. load some known content into the kubo node's blockstore (because the experiment won't fetch remote content)
  3. create and register libp2p handler for /http/1.1 (I don't think one exists yet? the development of this example can be used when creating http over libp2p for js-libp2p) via components.registrar.register
  4. Ensure we can send an http request to that kubo node listening on the /http transport, and get a valid http response back.
SgtPooki commented 2 weeks ago

@acul71 Go ahead and take this one if you want