Skip to content

Commit 697d3cd

Browse files
committed
fix: pubsub flag defaults
1 parent 9ba61d7 commit 697d3cd

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"dirty-chai": "^2.0.1",
8888
"go-ipfs-dep": "~0.4.22",
8989
"husky": "^3.0.4",
90-
"ipfs": "~0.37.1",
90+
"ipfs": "ipfs/js-ipfs#feat/gossipsub-as-default-pubsub",
9191
"is-running": "^2.1.0",
9292
"lint-staged": "^9.2.5",
9393
"proxyquire": "^2.1.3",

src/ipfsd-in-proc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,15 @@ class InProc extends EventEmitter {
3939
pubsub: false,
4040
sharding: false
4141
})
42+
this.opts.pubsub = defaultsDeep({}, opts.pubsub, {
43+
enabled: false
44+
})
4245

4346
this.opts.args.forEach((arg) => {
4447
if (arg === '--enable-pubsub-experiment') {
4548
this.opts.EXPERIMENTAL.pubsub = true
4649
} else if (arg === '--enable-pubsub') {
47-
this.opts.pubsub = true
50+
this.opts.pubsub.enabled = true
4851
} else if (arg === '--enable-sharding-experiment') {
4952
this.opts.EXPERIMENTAL.sharding = true
5053
} else if (arg === '--enable-namesys-pubsub') {
@@ -68,6 +71,7 @@ class InProc extends EventEmitter {
6871
offline: this.opts.offline,
6972
EXPERIMENTAL: this.opts.EXPERIMENTAL,
7073
libp2p: this.opts.libp2p,
74+
pubsub: this.opts.pubsub,
7175
config: this.opts.config,
7276
relay: this.opts.relay
7377
})

test/spawn-options.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ describe('Spawn options', function () {
314314
this.timeout(20 * 1000)
315315

316316
const options = {
317-
args: ['--enable-pubsub-experiment'],
317+
args: [fOpts.type !== 'go' ? '--enable-pubsub' : '--enable-pubsub-experiment'],
318318
initOptions: { bits: fOpts.bits, profile: 'test' }
319319
}
320320

0 commit comments

Comments
 (0)