diff --git a/package.json b/package.json index f3bde79f98..51ea58c4b6 100644 --- a/package.json +++ b/package.json @@ -126,10 +126,10 @@ "joi": "^14.3.0", "joi-browser": "^13.4.0", "joi-multiaddr": "^4.0.0", - "libp2p": "~0.25.0-rc.0", + "libp2p": "~0.25.0-rc.3", "libp2p-bootstrap": "~0.9.3", "libp2p-crypto": "~0.16.0", - "libp2p-kad-dht": "~0.14.4", + "libp2p-kad-dht": "~0.14.5", "libp2p-keychain": "~0.3.3", "libp2p-mdns": "~0.12.0", "libp2p-mplex": "~0.8.4", diff --git a/src/core/components/libp2p.js b/src/core/components/libp2p.js index c45b65f625..cc064e869a 100644 --- a/src/core/components/libp2p.js +++ b/src/core/components/libp2p.js @@ -93,7 +93,10 @@ function defaultBundle ({ datastore, peerInfo, peerBook, options, config }) { } }, connectionManager: get(options, 'connectionManager', - get(config, 'connectionManager', {})) + { + maxPeers: get(config, 'Swarm.ConnMgr.HighWater'), + minPeers: get(config, 'Swarm.ConnMgr.LowWater') + }) } const libp2pOptions = defaultsDeep(get(options, 'libp2p', {}), libp2pDefaults) diff --git a/src/core/runtime/config-browser.js b/src/core/runtime/config-browser.js index ca8c99e153..61e31eca36 100644 --- a/src/core/runtime/config-browser.js +++ b/src/core/runtime/config-browser.js @@ -25,5 +25,11 @@ module.exports = () => ({ '/dns4/nyc-2.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64', '/dns4/node0.preload.ipfs.io/tcp/443/wss/ipfs/QmZMxNdpMkewiVZLMRxaNxUeZpDUb34pWjZ1kZvsd16Zic', '/dns4/node1.preload.ipfs.io/tcp/443/wss/ipfs/Qmbut9Ywz9YEDrz8ySBSgWyJk41Uvm2QJPhwDJzJyGFsD6' - ] + ], + Swarm: { + ConnMgr: { + LowWater: 600, + HighWater: 900 + } + } }) diff --git a/src/core/runtime/config-nodejs.js b/src/core/runtime/config-nodejs.js index 5b301d1e20..4cc6584fe0 100644 --- a/src/core/runtime/config-nodejs.js +++ b/src/core/runtime/config-nodejs.js @@ -38,5 +38,11 @@ module.exports = () => ({ '/ip6/2604:a880:1:20::1d9:6001/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx', '/dns4/node0.preload.ipfs.io/tcp/443/wss/ipfs/QmZMxNdpMkewiVZLMRxaNxUeZpDUb34pWjZ1kZvsd16Zic', '/dns4/node1.preload.ipfs.io/tcp/443/wss/ipfs/Qmbut9Ywz9YEDrz8ySBSgWyJk41Uvm2QJPhwDJzJyGFsD6' - ] + ], + Swarm: { + ConnMgr: { + LowWater: 600, + HighWater: 900 + } + } })