Skip to content

Commit 3659bd8

Browse files
AndreiRegianidavidmarkclements
authored andcommittedMar 10, 2025
fix DHT_BOOTSTRAP format (#640)
1 parent 6d3fc5e commit 3659bd8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎subsystems/sidecar/index.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ const {
2828
WAKEUP, SALT, KNOWN_NODES_LIMIT
2929
} = require('pear-api/constants')
3030
const { ERR_INTERNAL_ERROR, ERR_PERMISSION_REQUIRED } = require('pear-api/errors')
31-
const DHT_BOOTSTRAP = require('pear-api/cmd')(Bare.argv.slice(1)).flags.dhtBootstrap
31+
const DHT_BOOTSTRAP = require('pear-api/cmd')(Bare.argv.slice(1))
32+
.flags.dhtBootstrap?.split(',')
33+
.map((hostPort) => {
34+
const [host, portStr] = hostPort.split(':')
35+
const port = Number(portStr)
36+
if (Number.isNaN(port)) throw new Error(`Invalid port: ${portStr}`)
37+
return { host, port }
38+
})
3239
const reports = require('./lib/reports')
3340
const Applings = require('./lib/applings')
3441
const Bundle = require('./lib/bundle')

0 commit comments

Comments
 (0)
Please sign in to comment.