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

Commit c21d362

Browse files
committed
chore: address review
1 parent 011827d commit c21d362

File tree

17 files changed

+36
-31
lines changed

17 files changed

+36
-31
lines changed

examples/circuit-relaying/src/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ document.addEventListener('DOMContentLoaded', async () => {
3636
enabled: true // make this node a relay (HOP)
3737
}
3838
},
39-
EXPERIMENTAL: {
40-
pubsub: true // enable pubsub
39+
pubsub: {
40+
enabled: true
4141
},
4242
config: {
4343
Bootstrap: []

examples/custom-libp2p/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ const libp2pBundle = (opts) => {
9696
timeout: 2e3 // End the query quickly since we're running so frequently
9797
}
9898
},
99-
EXPERIMENTAL: {
100-
pubsub: true
99+
pubsub: {
100+
enabled: true
101101
}
102102
}
103103
})

examples/custom-libp2p/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"license": "MIT",
1111
"dependencies": {
1212
"ipfs": "file:../../",
13-
"libp2p": "~0.25.0",
13+
"libp2p": "~0.26.1",
1414
"libp2p-bootstrap": "~0.9.7",
1515
"libp2p-kad-dht": "~0.15.0",
1616
"libp2p-mdns": "~0.12.2",

examples/exchange-files-in-browser/public/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ let info
4444
async function start () {
4545
if (!node) {
4646
const options = {
47-
EXPERIMENTAL: {
48-
pubsub: true
47+
pubsub: {
48+
enabled: true
4949
},
5050
repo: 'ipfs-' + Math.random(),
5151
config: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
"form-data": "^2.5.1",
196196
"hat": "0.0.3",
197197
"interface-ipfs-core": "^0.111.0",
198-
"ipfsd-ctl": "^0.44.1",
198+
"ipfsd-ctl": "ipfs/js-ipfsd-ctl#fix/pubsub-flag-defaults",
199199
"libp2p-websocket-star": "~0.10.2",
200200
"ncp": "^2.0.0",
201201
"p-event": "^4.1.0",

src/cli/commands/daemon.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
type: 'boolean',
1717
default: false
1818
})
19-
.option('enable-pubsub-experiment', {
19+
.option('enable-pubsub', {
2020
type: 'boolean',
2121
default: false
2222
})
@@ -53,8 +53,8 @@ module.exports = {
5353
offline: argv.offline,
5454
pass: argv.pass,
5555
preload: { enabled: argv.enablePreload },
56+
pubsub: { enabled: argv.enablePubsub },
5657
EXPERIMENTAL: {
57-
pubsub: argv.enablePubsubExperiment,
5858
ipnsPubsub: argv.enableNamesysPubsub,
5959
dht: argv.enableDhtExperiment,
6060
sharding: argv.enableShardingExperiment

src/cli/daemon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Daemon {
3030
async start () {
3131
this._log('starting')
3232

33-
const libp2p = { modules: {} }
33+
const libp2p = { modules: {}, config: {} }
3434

3535
// Attempt to use any of the WebRTC versions available globally
3636
let electronWebRTC

src/cli/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ exports.getIPFS = (argv, callback) => {
5050
init: false,
5151
start: false,
5252
pass: argv.pass,
53-
EXPERIMENTAL: {
54-
pubsub: true
53+
pubsub: {
54+
enabled: true
5555
}
5656
})
5757

src/core/components/libp2p.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function defaultBundle ({ datastore, peerInfo, peerBook, options, config }) {
119119
}
120120
},
121121
pubsub: {
122-
enabled: get(options, 'EXPERIMENTAL.pubsub', false)
122+
enabled: get(options, 'pubsub.enabled', false)
123123
}
124124
},
125125
connectionManager: get(options, 'connectionManager',

src/core/config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ const configSchema = s({
3232
addresses: optional(s(['multiaddr'])),
3333
interval: 'number?'
3434
}, { enabled: true, interval: 30 * 1000 }),
35+
pubsub: optional(s({
36+
enabled: 'boolean?'
37+
})),
3538
init: optional(union(['boolean', s({
3639
bits: 'number?',
3740
emptyRepo: 'boolean?',

0 commit comments

Comments
 (0)