I’m just copying my question from share.ipfs.io - pcp interoperability · Issue #127 · ipfs-shipyard/ipfs-share-files · GitHub to this platform.
I’m trying to let pcp interop with
I saw that
share.ipfs.io uses the libp2p/js-libp2p-webrtc-star transport, so I jumped in and started my own implementation of a go-libp2p-webrtc-star transport based on mtojek/go-libp2p-webrtc-star (which is outdated) and libp2p/go-libp2p-webrtc-direct.
I still have trouble to completely grasp the peer and content discovery flow though. Please correct me if I’m wrong:
js-libp2p-webrtc-staris not only used as a transport but also for peer discovery via its
discoveryproperty (next to the
- When a user opens
share.ipfs.iothe web app opens a websocket connection to and registers itself at the signalling star (and simultaneously connects to the set of bootstrap nodes)
- Then the signalling star tells the app about all currently connected peers
autoDialis enabled, the app optimistically connects to all peers by exchanging ICE candidates through the signalling star.
Now I’m wondering how content is discovered if users access the app with a CID URL fragment. If my understanding above is correct I could imagine that:
- the app connects to more and more peers and optimistically exchanges bitswap messages with newly connected peers until it finds the right peer.
- the app somehow leverages
pubsub. I saw that
pubsubwith Gossipsub is enabled but I can’t see any use of it.
- something else?
- Is there a similar inter-module-communication mechanism for the double responsibility of the
js-libp2p-webrtc-startransport that also does peer discovery in the
- Just to tighten my understanding: Is the
Bootstrapdiscovery mechanism strictly necessary? Due to
autoDialand peers discovered through the signalling server.