blind-peer 2.8.3 → 2.9.0
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 +16 -0
- package/index.js +2 -0
- package/package.json +2 -2
package/bin.js
CHANGED
|
@@ -60,6 +60,10 @@ const cmd = command(
|
|
|
60
60
|
'--repl [repl]',
|
|
61
61
|
'Expose a repl-swarm at the passed-in seed (32 bytes in hex or z32 notation). Use for debugging only.'
|
|
62
62
|
),
|
|
63
|
+
flag(
|
|
64
|
+
'--auto-shutdown-minutes [auto-shutdown-minutes]',
|
|
65
|
+
'(Temporary, Advanced) Automatically shut the process down after X minutes, with a variation of 20%'
|
|
66
|
+
),
|
|
63
67
|
async function ({ flags }) {
|
|
64
68
|
const debug = flags.debug
|
|
65
69
|
const logger = pino({
|
|
@@ -290,6 +294,18 @@ const cmd = command(
|
|
|
290
294
|
|
|
291
295
|
logger.info(`Listening at ${idEnc.normalize(blindPeer.publicKey)}`)
|
|
292
296
|
logger.info(`Encryption public key is ${idEnc.normalize(blindPeer.encryptionPublicKey)}`)
|
|
297
|
+
|
|
298
|
+
if (flags.autoShutdownMinutes) {
|
|
299
|
+
const delay = flags.autoShutdownMinutes * (1 + Math.random() / 5)
|
|
300
|
+
logger.warn(`Automatically shutting down the process in ${delay} minutes`)
|
|
301
|
+
setTimeout(
|
|
302
|
+
() => {
|
|
303
|
+
logger.warn('Auto-shutdown triggered. Shutting down...')
|
|
304
|
+
goodbye.exit()
|
|
305
|
+
},
|
|
306
|
+
delay * 60 * 1000
|
|
307
|
+
)
|
|
308
|
+
}
|
|
293
309
|
}
|
|
294
310
|
)
|
|
295
311
|
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blind-peer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Blind peers help keep hypercores available",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"paparam": "^1.8.0",
|
|
25
25
|
"pino": "^9.6.0",
|
|
26
26
|
"protomux-rpc": "^1.7.1",
|
|
27
|
-
"protomux-wakeup": "^2.
|
|
27
|
+
"protomux-wakeup": "^2.7.0",
|
|
28
28
|
"ready-resource": "^1.1.2",
|
|
29
29
|
"repl-swarm": "^2.3.0",
|
|
30
30
|
"rocksdb-native": "^3.1.6",
|