Skip to content

Commit c462d1a

Browse files
committed
docs: make example from README copy & pastable
The example in the README can now be used with simply copy & pasting, no errors will be thrown. Fixes #234.
1 parent eddec7d commit c462d1a

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

README.md

+3-9
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,8 @@ const defaultsDeep = require('@nodeutils/defaults-deep')
118118
const Protector = require('libp2p-pnet')
119119

120120
class Node extends libp2p {
121-
constructor (_peerInfo, _peerBook, _options) {
121+
constructor (_options) {
122122
const defaults = {
123-
peerInfo: _peerInfo, // The Identity of your Peer
124-
peerBook: _peerBook, // Where peers get tracked, if undefined libp2p will create one instance
125-
126123
// The libp2p modules for this libp2p bundle
127124
modules: {
128125
transport: [
@@ -136,12 +133,11 @@ class Node extends libp2p {
136133
connEncryption: [
137134
SECIO
138135
],
139-
connProtector: new Protector(/*protector specific opts*/),
136+
// Encryption for private networks. Needs additional private key to work
137+
// connProtector: new Protector(/*protector specific opts*/),
140138
peerDiscovery: [
141139
MulticastDNS
142140
],
143-
peerRouting: {}, // Currently both peerRouting and contentRouting are patched through the DHT,
144-
contentRouting: {}, // this will change once we factor that into two modules, for now do the following line:
145141
dht: DHT // DHT enables PeerRouting, ContentRouting and DHT itself components
146142
},
147143

@@ -158,8 +154,6 @@ class Node extends libp2p {
158154
}
159155
// .. other discovery module options.
160156
},
161-
peerRouting: {},
162-
contentRouting: {},
163157
relay: { // Circuit Relay options
164158
enabled: false,
165159
hop: {

0 commit comments

Comments
 (0)