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
Copy file name to clipboardExpand all lines: API.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ const libp2p = new Libp2p(options)
72
72
Required keys in the `options` object:
73
73
74
74
-`peerInfo`: instance of [PeerInfo][] that contains the [PeerId][], Keys and [multiaddrs][multiaddr] of the libp2p Node.
75
-
-`modules.transport`: An array that must include at least 1 transport, such as [`libp2p-tcp`](https://github.com/libp2p/js-libp2p-tcp).
75
+
-`modules.transport`: An array that must include at least 1 compliant transport. See [modules that implement the transport interface](https://github.com/libp2p/js-interfaces/tree/master/src/transport#modules-that-implement-the-interface).
76
76
77
77
## Libp2p Instance Methods
78
78
@@ -178,12 +178,12 @@ Dials to another peer in the network and selects a protocol to communicate with
Registers a given handler for the given protocols.
211
+
Sets up [multistream-select routing](https://github.com/multiformats/multistream-select) of protocols to their application handlers. Whenever a stream is opened on one of the provided protocols, the handler will be called. `handle` must be called in order to register a handler and support for a given protocol. This also informs other peers of the protocols you support.
212
212
213
213
`libp2p.handle(protocols, handler)`
214
214
@@ -247,12 +247,12 @@ Unregisters all handlers with the given protocols
247
247
248
248
```js
249
249
// ...
250
-
libp2p.unhandle('/echo/1.0.0')
250
+
libp2p.unhandle(['/echo/1.0.0'])
251
251
```
252
252
253
253
### peerRouting.findPeer
254
254
255
-
Iterates over all peer routers in series to find the given peer.
255
+
Iterates over all peer routers in series to find the given peer. If the DHT is enabled, it will be tried first.
0 commit comments