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

Commit

Permalink
fix: js-ipfs daemon config params (#914)
Browse files Browse the repository at this point in the history
* Fix js-ipfs daemon config params

  - Respect `--enable-experimental-pubsub`
  - Don't overload repo config with cli args (fixes #868)
  - Typo

* Treat cli args and config overload as seperate

- Add an extra parameter for `HttpAPI` for `cliArgs`
  • Loading branch information
sktt authored and daviddias committed Jul 19, 2017
1 parent d075667 commit e00b96f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/cli/commands/daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
default: false
},
'enable-pubsub-experiment': {
type: 'booleam',
type: 'boolean',
default: false
}
},
Expand All @@ -25,7 +25,7 @@ module.exports = {
console.log('Initializing daemon...')

const repoPath = utils.getRepoPath()
httpAPI = new HttpAPI(process.env.IPFS_PATH, argv)
httpAPI = new HttpAPI(process.env.IPFS_PATH, null, argv)

httpAPI.start((err) => {
if (err && err.code === 'ENOENT' && err.message.match(/Uninitalized repo/i)) {
Expand Down
6 changes: 3 additions & 3 deletions src/http-api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function uriToMultiaddr (uri) {
return `/ip4/${ipPort[0]}/tcp/${ipPort[1]}`
}

function HttpApi (repo, config) {
function HttpApi (repo, config, cliArgs) {
this.node = undefined
this.server = undefined

Expand Down Expand Up @@ -55,8 +55,8 @@ function HttpApi (repo, config) {
start: true,
config: config,
EXPERIMENTAL: {
pubsub: true,
sharding: config && config.enableShardingExperiment
pubsub: cliArgs && cliArgs.enablePubsubExperiment,
sharding: cliArgs && cliArgs.enableShardingExperiment
},
libp2p: libp2p
})
Expand Down

0 comments on commit e00b96f

Please sign in to comment.