You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs: update mdns example and docs
* docs: add link to specs
---------
Co-authored-by: Daniel N <[email protected]>
Co-authored-by: Chad Nehemiah <[email protected]>
If none of the available peer discovery protocols fulfills your needs, you can create a libp2p compatible one. A libp2p peer discovery protocol just needs to be compliant with the [Peer Discovery Interface](https://github.com/libp2p/js-libp2p/tree/main/packages/interface/src/peer-discovery).
136
136
137
-
If you want to know more about libp2p peer discovery, you should read the following content:
> Content routing provides a way to find where content lives in the network. It works in two steps: 1) Peers provide (announce) to the network that they are holders of specific content and 2) Peers issue queries to find where that content lives. A Content Routing mechanism could be as complex as a DHT or as simple as a registry somewhere in the network.
console.log('Discovered new peer:', event.detail.id.toString())
305
+
node.dial(event.detail.multiaddrs)
306
+
})
306
307
```
307
308
309
+
Note the `bootstrap` peer discovery module will automatically dial the bootstrap peers when the node starts up, while `mdns` will only trigger the `peer:discovery` event when a new peer is discovered.
310
+
311
+
312
+
308
313
#### Customizing Pubsub
309
314
310
315
Before a peer can subscribe to a topic it must find other peers and establish network connections with them. The pub/sub system doesn’t have any way to discover peers by itself. Instead, it relies upon the application to find new peers on its behalf, a process called ambient peer discovery.
0 commit comments