blind-peer 2.8.0 → 2.8.1
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 +7 -5
- package/package.json +1 -1
package/bin.js
CHANGED
|
@@ -79,13 +79,13 @@ const cmd = command('blind-peer',
|
|
|
79
79
|
})
|
|
80
80
|
|
|
81
81
|
blindPeer.on('announce-core', core => {
|
|
82
|
-
logger.info(`Started announcing core ${coreToInfo(core)}`)
|
|
82
|
+
logger.info(`Started announcing core ${coreToInfo(core, true)}`)
|
|
83
83
|
})
|
|
84
84
|
blindPeer.on('core-downloaded', core => {
|
|
85
|
-
logger.info(`Announced core fully downloaded: ${coreToInfo(core)}`)
|
|
85
|
+
logger.info(`Announced core fully downloaded: ${coreToInfo(core, true)}`)
|
|
86
86
|
})
|
|
87
87
|
blindPeer.on('core-append', core => {
|
|
88
|
-
logger.info(`Detected announced-core length update: ${coreToInfo(core)}`)
|
|
88
|
+
logger.info(`Detected announced-core length update: ${coreToInfo(core, true)}`)
|
|
89
89
|
})
|
|
90
90
|
|
|
91
91
|
blindPeer.on('gc-start', ({ bytesToClear }) => {
|
|
@@ -229,9 +229,11 @@ function streamToStr (stream) {
|
|
|
229
229
|
return `${pubKey}`
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
function coreToInfo (core) {
|
|
232
|
+
function coreToInfo (core, includePublicKey = false) {
|
|
233
233
|
const discKey = hypCrypto.discoveryKey(core.key)
|
|
234
|
-
|
|
234
|
+
let res = `Discovery key ${idEnc.normalize(discKey)} (${core.contiguousLength} / ${core.length}, ${core.peers.length} peers)`
|
|
235
|
+
if (includePublicKey) res += `. Public key: ${idEnc.normalize(core.key)}`
|
|
236
|
+
return res
|
|
235
237
|
}
|
|
236
238
|
|
|
237
239
|
cmd.parse()
|