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

Commit de627b9

Browse files
authored
Merge pull request #803 from ipfs/fix/bootstrap
feat: bootstrap is enabled by default now
2 parents 2642417 + 64cde5d commit de627b9

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
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

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)