dht-rpc 5.0.1 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -7
- package/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -114,11 +114,6 @@ Options include:
|
|
|
114
114
|
|
|
115
115
|
``` js
|
|
116
116
|
{
|
|
117
|
-
// Whether or not this node is ephemeral or should join the routing table
|
|
118
|
-
ephemeral: false,
|
|
119
|
-
// If you don't explicitly specific the ephemerality, the node will automatically
|
|
120
|
-
// figure it out in adaptive mode, based on your NAT settings, uptime and some other heuristics
|
|
121
|
-
adaptive: true,
|
|
122
117
|
// A list of bootstrap nodes
|
|
123
118
|
bootstrap: [ 'bootstrap-node.com:24242', ... ],
|
|
124
119
|
// Optionally pass in your own UDP socket to use.
|
|
@@ -132,8 +127,9 @@ Options include:
|
|
|
132
127
|
}
|
|
133
128
|
```
|
|
134
129
|
|
|
135
|
-
|
|
136
|
-
|
|
130
|
+
Nodes per default use something called adaptive mode to decide whether or not they want to join other nodes' routing table.
|
|
131
|
+
This includes things like node uptime, if the node is firewalled etc. Adaptive mode is conservative, so it might take ~20-30 mins for the node to turn persistent. If you are making a test case with your own bootstrap network you'd usually want to turn this off to make sure your test finishes in a timely maner. You can do this by passing `ephemeral: false` in the constructor.
|
|
132
|
+
For the vast majority of use-cases you should always use adaptive mode to ensure good DHT health, ie the defaults.
|
|
137
133
|
|
|
138
134
|
Your DHT routing id is `hash(publicIp + publicPort)` and will be autoconfigured internally.
|
|
139
135
|
|
package/index.js
CHANGED
|
@@ -55,7 +55,7 @@ class DHT extends EventEmitter {
|
|
|
55
55
|
this._lastHost = null
|
|
56
56
|
this._onrow = (row) => row.on('full', (node) => this._onfullrow(node, row))
|
|
57
57
|
this._nonePersistentSamples = []
|
|
58
|
-
this._bootstrapping = this.bootstrap()
|
|
58
|
+
this._bootstrapping = this.bootstrap().catch(noop)
|
|
59
59
|
|
|
60
60
|
this.table.on('row', this._onrow)
|
|
61
61
|
|