Comparing version 6.11.2 to 6.11.3
@@ -48,2 +48,3 @@ const { EventEmitter } = require('events') | ||
this.online = true | ||
this.stats = { queries: { active: 0, total: 0 } } | ||
@@ -50,0 +51,0 @@ this._nat = new NatSampler() |
@@ -13,2 +13,5 @@ const { Readable } = require('streamx') | ||
dht.stats.queries.total++ | ||
dht.stats.queries.active++ | ||
this.dht = dht | ||
@@ -342,2 +345,3 @@ this.k = this.dht.table.k | ||
_destroy (cb) { | ||
this.dht.stats.queries.active-- | ||
if (!this._online && this.dht.online) this.dht._offline() | ||
@@ -344,0 +348,0 @@ if (this._autoDestroySession) this._session.destroy() |
{ | ||
"name": "dht-rpc", | ||
"version": "6.11.2", | ||
"version": "6.11.3", | ||
"description": "Make RPC calls over a Kademlia based DHT", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -129,3 +129,3 @@ # dht-rpc | ||
Nodes per default use something called adaptive mode to decide whether or not they want to join other nodes' routing table. | ||
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. | ||
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 manner. You can do this by passing `ephemeral: false` in the constructor. | ||
For the vast majority of use-cases you should always use adaptive mode to ensure good DHT health, ie the defaults. | ||
@@ -137,3 +137,3 @@ | ||
Make a bootstrap node for your DHT. The port and host needs to be it's globally accessable port and host. | ||
Make a bootstrap node for your DHT. The port and host needs to be its globally accessible port and host. | ||
Note: `port` and `host` parameters are used to create the node id. Use `options.host` if you want to bind to i.e. 127.0.0.1. | ||
@@ -153,3 +153,3 @@ DHT nodes can use any other DHT node to bootstrap, but a bootstrap node can bootstrap itself, by itself. | ||
A boolean indicating if you are currently epheremal or not | ||
A boolean indicating if you are currently ephemeral or not | ||
@@ -262,3 +262,3 @@ #### `node.on('bootstrap')` | ||
Normally you'd set the token when commiting to the dht in the query's commit hook. | ||
Normally you'd set the token when committing to the dht in the query's commit hook. | ||
@@ -322,3 +322,3 @@ #### `reply = await node.ping(to, [options])` | ||
map (reply) { | ||
// map the reply into what you want returned on the stram | ||
// map the reply into what you want returned on the stream | ||
return { onlyValue: reply.value } | ||
@@ -325,0 +325,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62831
1439