blind-peer 2.7.7 → 2.7.8
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/bin.js +10 -5
- package/package.json +2 -2
package/bin.js
CHANGED
|
@@ -8,6 +8,7 @@ const RegisterClient = require('autobase-discovery/client/register')
|
|
|
8
8
|
const safetyCatch = require('safety-catch')
|
|
9
9
|
const byteSize = require('tiny-byte-size')
|
|
10
10
|
const pino = require('pino')
|
|
11
|
+
const b4a = require('b4a')
|
|
11
12
|
|
|
12
13
|
const BlindPeer = require('.')
|
|
13
14
|
|
|
@@ -113,11 +114,10 @@ const cmd = command('blind-peer',
|
|
|
113
114
|
)
|
|
114
115
|
}
|
|
115
116
|
|
|
116
|
-
await blindPeer.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
await blindPeer.ready() // needed to be able to access the swarm object
|
|
118
|
+
blindPeer.swarm.on('ban', (peerInfo, err) => {
|
|
119
|
+
logger.warn(`Banned peer: ${b4a.toString(peerInfo.publicKey, 'hex')}.\n${err.stack}`)
|
|
120
|
+
})
|
|
121
121
|
if (debug) {
|
|
122
122
|
blindPeer.swarm.on('connection', (conn, peerInfo) => {
|
|
123
123
|
const key = idEnc.normalize(peerInfo.publicKey)
|
|
@@ -126,6 +126,11 @@ const cmd = command('blind-peer',
|
|
|
126
126
|
})
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
await blindPeer.listen()
|
|
130
|
+
|
|
131
|
+
logger.info(`Blind peer listening, local address is ${blindPeer.swarm.dht.localAddress().host}:${blindPeer.swarm.dht.localAddress().port}`)
|
|
132
|
+
logger.info(`Bytes allocated: ${byteSize(blindPeer.digest.bytesAllocated)} of ${byteSize(blindPeer.maxBytes)}`)
|
|
133
|
+
|
|
129
134
|
if (flags.autodiscoveryRpcKey) {
|
|
130
135
|
const autodiscoveryRpcKey = idEnc.decode(flags.autodiscoveryRpcKey)
|
|
131
136
|
const seed = idEnc.decode(flags.autodiscoverySeed)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blind-peer",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.8",
|
|
4
4
|
"description": "Blind peers help keep hypercores available",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"hypercore-id-encoding": "^1.3.0",
|
|
21
21
|
"hyperdb": "^4.9.4",
|
|
22
22
|
"hyperschema": "^1.10.3",
|
|
23
|
-
"hyperswarm": "^4.
|
|
23
|
+
"hyperswarm": "^4.13.0",
|
|
24
24
|
"paparam": "^1.8.0",
|
|
25
25
|
"pino": "^9.6.0",
|
|
26
26
|
"protomux-rpc": "^1.7.1",
|