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: README.md
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -207,46 +207,46 @@ Required keys in the `options` object:
207
207
208
208
> Start the libp2p Node.
209
209
210
-
`callback`is a function with the following `function (err) {}` signature, where `err` is an Error in case starting the node fails.
210
+
`callback` following signature `function (err) {}`, where `err` is an Error in case starting the node fails.
211
211
212
212
#### `libp2p.stop(callback)`
213
213
214
214
> Stop the libp2p Node.
215
215
216
-
`callback`is a function with the following `function (err) {}` signature, where `err` is an Error in case stopping the node fails.
216
+
`callback` following signature `function (err) {}`, where `err` is an Error in case stopping the node fails.
217
217
218
218
#### `libp2p.dial(peer, callback)`
219
219
220
220
> Dials to another peer in the network, establishes the connection.
221
221
222
222
-`peer`: can be an instance of [PeerInfo][], [PeerId][], [multiaddr][], or a multiaddr string
223
-
-`callback`is a function with the following `function (err, conn) {}` signature, where `err` is an Error in of failure to dial the connection and `conn` is a [Connection][] instance in case of a protocol selected, if not it is undefined.
223
+
-`callback` following signature `function (err, conn) {}`, where `err` is an Error in of failure to dial the connection and `conn` is a [Connection][] instance in case of a protocol selected, if not it is undefined.
> Dials to another peer in the network and selects a protocol to talk with that peer.
228
228
229
229
-`peer`: can be an instance of [PeerInfo][], [PeerId][], [multiaddr][], or a multiaddr string
230
230
-`protocol`: String that defines the protocol (e.g '/ipfs/bitswap/1.1.0')
231
-
-`callback`: Function with signature `function (err, conn) {}` where `conn` is a [Connection](https://github.com/libp2p/interface-connection) object
231
+
-`callback`: Function with signature `function (err, conn) {}`, where `conn` is a [Connection](https://github.com/libp2p/interface-connection) object
232
232
233
-
`callback`is a function with the following `function (err, conn) {}` signature, where `err` is an Error in of failure to dial the connection and `conn` is a [Connection][] instance in case of a protocol selected, if not it is undefined.
233
+
`callback` following signature `function (err, conn) {}`, where `err` is an Error in of failure to dial the connection and `conn` is a [Connection][] instance in case of a protocol selected, if not it is undefined.
234
234
235
235
#### `libp2p.dialFSM(peer, protocol, callback)`
236
236
237
237
> Behaves like `.dial` and `.dialProtocol` but calls back with a Connection State Machine
238
238
239
239
-`peer`: can be an instance of [PeerInfo][], [PeerId][], [multiaddr][], or a multiaddr string
240
240
-`protocol`: an optional String that defines the protocol (e.g '/ipfs/bitswap/1.1.0')
241
-
-`callback`: Function with signature `function (err, connFSM) {}` where `connFSM` is a [Connection State Machine](https://github.com/libp2p/js-libp2p-switch#connection-state-machine)
241
+
-`callback`: following signature `function (err, connFSM) {}`, where `connFSM` is a [Connection State Machine](https://github.com/libp2p/js-libp2p-switch#connection-state-machine)
242
242
243
243
#### `libp2p.hangUp(peer, callback)`
244
244
245
245
> Closes an open connection with a peer, graciously.
246
246
247
247
-`peer`: can be an instance of [PeerInfo][], [PeerId][] or [multiaddr][]
248
248
249
-
`callback`is a function with the following `function (err) {}` signature, where `err` is an Error in case stopping the node fails.
249
+
`callback` following signature `function (err) {}`, where `err` is an Error in case stopping the node fails.
@@ -272,7 +272,7 @@ Required keys in the `options` object:
272
272
> Handle new protocol
273
273
274
274
-`protocol`: String that defines the protocol (e.g '/ipfs/bitswap/1.1.0')
275
-
-`handlerFunc`: Function with signature `function (protocol, conn) {}` where `conn` is a [Connection](https://github.com/libp2p/interface-connection) object
275
+
-`handlerFunc`: following signature `function (protocol, conn) {}`, where `conn` is a [Connection](https://github.com/libp2p/interface-connection) object
276
276
-`matchFunc`: Function for matching on protocol (exact matching, semver, etc). Default to exact match.
277
277
278
278
#### `libp2p.unhandle(protocol)`
@@ -597,4 +597,4 @@ The libp2p implementation in JavaScript is a work in progress. As such, there ar
0 commit comments