mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-12 12:16:03 +00:00
docs: update API for node creation (#236)
The API changed recently, update the README to reflect that.
This commit is contained in:
parent
65e7223ce0
commit
fdd714ee60
@ -182,13 +182,13 @@ class Node extends libp2p {
|
|||||||
|
|
||||||
### API
|
### API
|
||||||
|
|
||||||
#### Create a Node - `new libp2p.Node([peerInfo, peerBook, options])`
|
#### Create a Node - `new libp2p.Node(options)`
|
||||||
|
|
||||||
> Creates an instance of the libp2p.Node.
|
> Creates an instance of the libp2p.Node.
|
||||||
|
|
||||||
- `peerInfo`: instance of [PeerInfo][] that contains the [PeerId][], Keys and [multiaddrs][multiaddr] of the libp2p Node. Optional.
|
Required keys in the `options` object:
|
||||||
- `peerBook`: instance of [PeerBook][] that contains the [PeerInfo][] of known peers. Optional.
|
|
||||||
- `options`: Object containing custom options for the bundle.
|
- `peerInfo`: instance of [PeerInfo][] that contains the [PeerId][], Keys and [multiaddrs][multiaddr] of the libp2p Node.
|
||||||
|
|
||||||
#### `libp2p.start(callback)`
|
#### `libp2p.start(callback)`
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user