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

Commit

Permalink
fix: move connection manager config out of experimental
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
  • Loading branch information
alanshaw committed Jul 3, 2018
1 parent 7e25222 commit 0eaaf4f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ Creates and returns an instance of an IPFS node. Use the `options` argument to s
- `enabled` (boolean): whether this module is enabled or disabled
- `[custom config]` (any): other keys are specific to the module

- `connectionManager` (object): Configure the libp2p connection manager, see the [documentation for available options](https://github.com/libp2p/js-libp2p-connection-manager#create-a-connectionmanager).

#### Events

IPFS instances are Node.js [EventEmitters](https://nodejs.org/dist/latest-v8.x/docs/api/events.html#events_class_eventemitter). You can listen for events by calling `node.on('event', handler)`:
Expand Down
7 changes: 2 additions & 5 deletions src/core/components/libp2p.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ module.exports = function libp2p (self) {
pubsub: get(self._options, 'EXPERIMENTAL.pubsub', false)
}
},
connectionManager: get(
self._options,
'EXPERIMENTAL.connectionManager',
get(config, 'EXPERIMENTAL.connectionManager')
)
connectionManager: get(self._options, 'connectionManager',
get(config, 'connectionManager', false))
}

const libp2pOptions = defaultsDeep(
Expand Down
4 changes: 2 additions & 2 deletions src/core/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ const schema = Joi.object().keys({
EXPERIMENTAL: Joi.object().keys({
pubsub: Joi.boolean(),
sharding: Joi.boolean(),
dht: Joi.boolean(),
connectionManager: Joi.object().allow(null)
dht: Joi.boolean()
}).allow(null),
connectionManager: Joi.object().allow(null),
config: Joi.object().keys({
Addresses: Joi.object().keys({
Swarm: Joi.array().items(Joi.multiaddr().options({ convert: false })),
Expand Down

0 comments on commit 0eaaf4f

Please sign in to comment.