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

Commit

Permalink
Merge pull request #803 from ipfs/fix/bootstrap
Browse files Browse the repository at this point in the history
feat: bootstrap is enabled by default now
  • Loading branch information
daviddias authored Mar 21, 2017
2 parents 2642417 + 64cde5d commit de627b9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function spawnDaemon (num, callback) {
API: `/ip4/127.0.0.1/tcp/31${num}`,
Gateway: `/ip4/127.0.0.1/tcp/32${num}`
},
Bootstrap: [],
Discovery: {
MDNS: {
Enabled: false
Expand Down
6 changes: 4 additions & 2 deletions src/core/components/libp2p.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ module.exports = function libp2p (self) {
})

self._libp2pNode.discovery.on('peer', (peerInfo) => {
self._peerInfoBook.put(peerInfo)
self._libp2pNode.dialByPeerInfo(peerInfo, () => {})
if (self.isOnline()) {
self._peerInfoBook.put(peerInfo)
self._libp2pNode.dialByPeerInfo(peerInfo, () => {})
}
})
self._libp2pNode.swarm.on('peer-mux-established', (peerInfo) => {
self._peerInfoBook.put(peerInfo)
Expand Down
6 changes: 4 additions & 2 deletions test/core/bitswap.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ describe('bitswap', () => {
MDNS: {
Enabled: false
}
}
},
Bootstrap: []
}
})
} else {
Expand All @@ -57,7 +58,8 @@ describe('bitswap', () => {
MDNS: {
Enabled: false
}
}
},
Bootstrap: []
}
})
}
Expand Down
5 changes: 4 additions & 1 deletion test/core/create-node.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ describe('create node', () => {

it('start and stop, start and stop', (done) => {
const node = new IPFS({
repo: createTempRepo()
repo: createTempRepo(),
config: {
Bootstrap: []
}
})

node.once('start', () => {
Expand Down

0 comments on commit de627b9

Please sign in to comment.