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

Commit 64cde5d

Browse files
committed
feat: bootstrap is enabled by default now
1 parent ae4bb9d commit 64cde5d

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

gulpfile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function spawnDaemon (num, callback) {
3434
API: `/ip4/127.0.0.1/tcp/31${num}`,
3535
Gateway: `/ip4/127.0.0.1/tcp/32${num}`
3636
},
37+
Bootstrap: [],
3738
Discovery: {
3839
MDNS: {
3940
Enabled: false

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@
114114
"isstream": "^0.1.2",
115115
"joi": "^10.2.2",
116116
"libp2p-floodsub": "~0.7.4",
117-
"libp2p-ipfs-browser": "~0.19.0",
118-
"libp2p-ipfs-nodejs": "~0.19.0",
117+
"libp2p-ipfs-browser": "~0.20.0",
118+
"libp2p-ipfs-nodejs": "~0.20.0",
119119
"lodash.flatmap": "^4.5.0",
120120
"lodash.get": "^4.4.2",
121121
"lodash.has": "^4.5.2",

src/core/components/libp2p.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ module.exports = function libp2p (self) {
3131
})
3232

3333
self._libp2pNode.discovery.on('peer', (peerInfo) => {
34-
self._peerInfoBook.put(peerInfo)
35-
self._libp2pNode.dialByPeerInfo(peerInfo, () => {})
34+
if (self.isOnline()) {
35+
self._peerInfoBook.put(peerInfo)
36+
self._libp2pNode.dialByPeerInfo(peerInfo, () => {})
37+
}
3638
})
3739
self._libp2pNode.swarm.on('peer-mux-established', (peerInfo) => {
3840
self._peerInfoBook.put(peerInfo)

test/core/bitswap.spec.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ describe('bitswap', () => {
4646
MDNS: {
4747
Enabled: false
4848
}
49-
}
49+
},
50+
Bootstrap: []
5051
}
5152
})
5253
} else {
@@ -57,7 +58,8 @@ describe('bitswap', () => {
5758
MDNS: {
5859
Enabled: false
5960
}
60-
}
61+
},
62+
Bootstrap: []
6163
}
6264
})
6365
}

test/core/create-node.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,10 @@ describe('create node', () => {
185185

186186
it('start and stop, start and stop', (done) => {
187187
const node = new IPFS({
188-
repo: createTempRepo()
188+
repo: createTempRepo(),
189+
config: {
190+
Bootstrap: []
191+
}
189192
})
190193

191194
node.once('start', () => {

0 commit comments

Comments
 (0)