blind-peer 2.7.8 → 2.7.10

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.
Files changed (2) hide show
  1. package/bin.js +6 -10
  2. package/package.json +2 -2
package/bin.js CHANGED
@@ -27,18 +27,18 @@ const cmd = command('blind-peer',
27
27
  flag('--scraper-public-key [scraper-public-key]', 'Public key of a dht-prometheus scraper. Can be hex or z32.'),
28
28
  flag('--scraper-secret [scraper-secret]', 'Secret of the dht-prometheus scraper. Can be hex or z32.'),
29
29
  flag('--scraper-alias [scraper-alias]', '(optional) Alias with which to register to the scraper'),
30
- flag('--repl', 'Expose a repl-swarm (use for debugging only)'),
30
+ flag('--repl [repl]', 'Expose a repl-swarm at the passed-in seed (32 bytes in hex or z32 notation). Use for debugging only.'),
31
31
  async function ({ flags }) {
32
32
  const debug = flags.debug
33
33
  const logger = pino({
34
- level: debug ? 'debug' : 'info'
34
+ level: debug ? 'debug' : 'info',
35
+ name: 'blind-peer'
35
36
  })
36
37
  logger.info('Starting blind peer')
37
38
 
38
39
  const storage = flags.storage || 'blind-peer'
39
40
  const port = flags.port ? parseInt(flags.port) : null
40
41
 
41
- const exposeRepl = flags.repl === true
42
42
  const maxBytes = 1_000_000 * parseInt(flags.maxStorage || DEFAULT_STORAGE_LIMIT_MB)
43
43
  const trustedPubKeys = (flags.trustedPeer || []).map(k => idEnc.decode(k))
44
44
 
@@ -103,15 +103,11 @@ const cmd = command('blind-peer',
103
103
  logger.info('Shut down blind peer')
104
104
  })
105
105
 
106
- if (exposeRepl) {
106
+ if (flags.repl) {
107
+ const seed = idEnc.decode(flags.repl)
107
108
  logger.warn('Setting up REPL swarm, enabling remote access to this process')
108
109
  const replSwarm = require('repl-swarm')
109
- const seed = replSwarm({ blindPeer, instrumentation })
110
- setInterval(
111
- () => {
112
- logger.info(`REPL swarm available at ${seed}`)
113
- }, 1000 * 60 * 60
114
- )
110
+ replSwarm({ seed, logSeed: false, blindPeer, instrumentation })
115
111
  }
116
112
 
117
113
  await blindPeer.ready() // needed to be able to access the swarm object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blind-peer",
3
- "version": "2.7.8",
3
+ "version": "2.7.10",
4
4
  "description": "Blind peers help keep hypercores available",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -26,7 +26,7 @@
26
26
  "protomux-rpc": "^1.7.1",
27
27
  "protomux-wakeup": "^2.2.0",
28
28
  "ready-resource": "^1.1.2",
29
- "repl-swarm": "^2.2.0",
29
+ "repl-swarm": "^2.3.0",
30
30
  "rocksdb-native": "^3.1.6",
31
31
  "safety-catch": "^1.0.2",
32
32
  "scope-lock": "^1.2.4",