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: doc/API.md
+2-4
Original file line number
Diff line number
Diff line change
@@ -174,15 +174,13 @@ for (const [peerId, connections] of libp2p.connections) {
174
174
175
175
### dial
176
176
177
-
Dials to another peer in the network and establishes the connection.
178
-
179
177
`dial(peer, options)`
180
178
181
179
#### Parameters
182
180
183
181
| Name | Type | Description |
184
182
|------|------|-------------|
185
-
| peer |[`PeerInfo`][peer-info]\|[`PeerId`][peer-id]\|[`Multiaddr`][multiaddr]\|`string`| peer to dial |
183
+
| peer |[`PeerInfo`][peer-info]\|[`PeerId`][peer-id]\|[`Multiaddr`][multiaddr]\|`string`|The peer to dial. If a [`Multiaddr`][multiaddr] or its string is provided, it **must** include the peer id|
186
184
|[options]|`Object`| dial options |
187
185
|[options.signal]|[`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)| An `AbortSignal` instance obtained from an [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) that can be used to abort the connection before it completes |
188
186
@@ -217,7 +215,7 @@ Dials to another peer in the network and selects a protocol to communicate with
217
215
218
216
| Name | Type | Description |
219
217
|------|------|-------------|
220
-
| peer |[`PeerInfo`][peer-info]\|[`PeerId`][peer-id]\|[`Multiaddr`][multiaddr]\|`string`| peer to dial |
218
+
| peer |[`PeerInfo`][peer-info]\|[`PeerId`][peer-id]\|[`Multiaddr`][multiaddr]\|`string`|The peer to dial. If a [`Multiaddr`][multiaddr] or its string is provided, it **must** include the peer id|
221
219
| protocols | `String|Array<String>` | A list of protocols (or single protocol) to negotiate with. Protocols are attempted in order until a match is made. (e.g '/ipfs/bitswap/1.1.0') |
222
220
|[options]|`Object`| dial options |
223
221
|[options.signal]|[`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)| An `AbortSignal` instance obtained from an [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) that can be used to abort the connection before it completes |
0 commit comments