Skip to content

Commit e50c6ab

Browse files
committed
chore: update pubsub (#801)
BREAKING CHANGE: pubsub signing policy properties were changed according to libp2p-interfaces changes to a single property. The emitSelf option default value was also modified to match the routers value
1 parent 49fffda commit e50c6ab

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

doc/CONFIGURATION.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,8 @@ const MPLEX = require('libp2p-mplex')
322322
const { NOISE } = require('libp2p-noise')
323323
const GossipSub = require('libp2p-gossipsub')
324324

325+
const { SignaturePolicy } = require('libp2p-interfaces/src/pubsub/signature-policy')
326+
325327
const node = await Libp2p.create({
326328
modules: {
327329
transport: [TCP],
@@ -332,9 +334,8 @@ const node = await Libp2p.create({
332334
config: {
333335
pubsub: { // The pubsub options (and defaults) can be found in the pubsub router documentation
334336
enabled: true,
335-
emitSelf: true, // whether the node should emit to self on publish
336-
signMessages: true, // if messages should be signed
337-
strictSigning: true // if message signing should be required
337+
emitSelf: false, // whether the node should emit to self on publish
338+
globalSignaturePolicy: SignaturePolicy.StrictSign // message signing policy
338339
}
339340
}
340341
})

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"it-pipe": "^1.1.0",
6161
"it-protocol-buffers": "^0.2.0",
6262
"libp2p-crypto": "^0.18.0",
63-
"libp2p-interfaces": "^0.5.1",
63+
"libp2p-interfaces": "^0.7.2",
6464
"libp2p-utils": "^0.2.1",
6565
"mafmt": "^8.0.0",
6666
"merge-options": "^2.0.0",
@@ -99,8 +99,8 @@
9999
"libp2p-bootstrap": "^0.12.0",
100100
"libp2p-delegated-content-routing": "^0.7.0",
101101
"libp2p-delegated-peer-routing": "^0.7.0",
102-
"libp2p-floodsub": "^0.23.0",
103-
"libp2p-gossipsub": "^0.6.0",
102+
"libp2p-floodsub": "^0.24.0",
103+
"libp2p-gossipsub": "^0.7.0",
104104
"libp2p-kad-dht": "^0.20.0",
105105
"libp2p-mdns": "^0.15.0",
106106
"libp2p-mplex": "^0.10.1",

src/config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ const DefaultConfig = {
5454
autoDial: true
5555
},
5656
pubsub: {
57-
enabled: true,
58-
emitSelf: true,
59-
signMessages: true,
60-
strictSigning: true
57+
enabled: true
6158
},
6259
relay: {
6360
enabled: true,

0 commit comments

Comments
 (0)