blind-peer 2.7.9 → 2.7.11

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 +4 -9
  2. package/package.json +3 -3
package/bin.js CHANGED
@@ -27,7 +27,7 @@ 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({
@@ -39,7 +39,6 @@ const cmd = command('blind-peer',
39
39
  const storage = flags.storage || 'blind-peer'
40
40
  const port = flags.port ? parseInt(flags.port) : null
41
41
 
42
- const exposeRepl = flags.repl === true
43
42
  const maxBytes = 1_000_000 * parseInt(flags.maxStorage || DEFAULT_STORAGE_LIMIT_MB)
44
43
  const trustedPubKeys = (flags.trustedPeer || []).map(k => idEnc.decode(k))
45
44
 
@@ -104,15 +103,11 @@ const cmd = command('blind-peer',
104
103
  logger.info('Shut down blind peer')
105
104
  })
106
105
 
107
- if (exposeRepl) {
106
+ if (flags.repl) {
107
+ const seed = idEnc.decode(flags.repl)
108
108
  logger.warn('Setting up REPL swarm, enabling remote access to this process')
109
109
  const replSwarm = require('repl-swarm')
110
- const seed = replSwarm({ blindPeer, instrumentation })
111
- setInterval(
112
- () => {
113
- logger.info(`REPL swarm available at ${seed}`)
114
- }, 1000 * 60 * 60
115
- )
110
+ replSwarm({ seed, logSeed: false, blindPeer, instrumentation })
116
111
  }
117
112
 
118
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.9",
3
+ "version": "2.7.11",
4
4
  "description": "Blind peers help keep hypercores available",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -20,13 +20,13 @@
20
20
  "hypercore-id-encoding": "^1.3.0",
21
21
  "hyperdb": "^4.9.4",
22
22
  "hyperschema": "^1.10.3",
23
- "hyperswarm": "^4.13.0",
23
+ "hyperswarm": "^4.13.1",
24
24
  "paparam": "^1.8.0",
25
25
  "pino": "^9.6.0",
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",