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

Commit

Permalink
feat: bootstrap is enabled by default now
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Mar 21, 2017
1 parent ae4bb9d commit 64cde5d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
"isstream": "^0.1.2",
"joi": "^10.2.2",
"libp2p-floodsub": "~0.7.4",
"libp2p-ipfs-browser": "~0.19.0",
"libp2p-ipfs-nodejs": "~0.19.0",
"libp2p-ipfs-browser": "~0.20.0",
"libp2p-ipfs-nodejs": "~0.20.0",
"lodash.flatmap": "^4.5.0",
"lodash.get": "^4.4.2",
"lodash.has": "^4.5.2",
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 64cde5d

Please sign in to comment.