Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 721a6ca

Browse files
committed
feat: bootstrap as an option
1 parent 7999b9d commit 721a6ca

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ Commands:
183183
- default repo location: `~/.jsipfs` (can be changed with env variable `IPFS_PATH`)
184184
- default swarm port: `4002`
185185
- default API port: `5002`
186+
- default Bootstrap is off, to enable it set `IPFS_BOOTSTRAP=1`
186187

187188
### HTTP-API
188189

src/cli/commands/swarm/peers.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ module.exports = {
2828
}
2929

3030
result.forEach((item) => {
31-
console.log(item.addr.toString())
31+
const addr = item.addr.toString() + item.peer.toB58String()
32+
console.log(addr)
3233
})
3334
})
3435
})

src/core/components/libp2p.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ const promisify = require('promisify-es6')
66
module.exports = function libp2p (self) {
77
return {
88
start: promisify((callback) => {
9-
self.config.get('Discovery.MDNS.Enabled', gotConfig)
9+
self.config.get(gotConfig)
1010

11-
function gotConfig (err, enabled) {
11+
function gotConfig (err, config) {
1212
if (err) {
1313
return callback(err)
1414
}
1515

16-
const options = { mdns: enabled }
16+
const options = {
17+
mdns: config.Discovery.MDNS.Enabled,
18+
bootstrap: config.Bootstrap
19+
}
1720

1821
self._libp2pNode = new Node(self._peerInfo, undefined, options)
1922

0 commit comments

Comments
 (0)