Skip to content

Commit

Permalink
chore: update pubsub (#801)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vasco-santos committed Dec 10, 2020
1 parent a4e858c commit 9205fce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
7 changes: 4 additions & 3 deletions doc/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ const MPLEX = require('libp2p-mplex')
const { NOISE } = require('libp2p-noise')
const GossipSub = require('libp2p-gossipsub')

const { SignaturePolicy } = require('libp2p-interfaces/src/pubsub/signature-policy')

const node = await Libp2p.create({
modules: {
transport: [TCP],
Expand All @@ -332,9 +334,8 @@ const node = await Libp2p.create({
config: {
pubsub: { // The pubsub options (and defaults) can be found in the pubsub router documentation
enabled: true,
emitSelf: true, // whether the node should emit to self on publish
signMessages: true, // if messages should be signed
strictSigning: true // if message signing should be required
emitSelf: false, // whether the node should emit to self on publish
globalSignaturePolicy: SignaturePolicy.StrictSign // message signing policy
}
}
})
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"it-pipe": "^1.1.0",
"it-protocol-buffers": "^0.2.0",
"libp2p-crypto": "^0.18.0",
"libp2p-interfaces": "^0.5.1",
"libp2p-interfaces": "^0.7.2",
"libp2p-utils": "^0.2.1",
"mafmt": "^8.0.0",
"merge-options": "^2.0.0",
Expand Down Expand Up @@ -99,8 +99,8 @@
"libp2p-bootstrap": "^0.12.0",
"libp2p-delegated-content-routing": "^0.7.0",
"libp2p-delegated-peer-routing": "^0.7.0",
"libp2p-floodsub": "^0.23.0",
"libp2p-gossipsub": "^0.6.0",
"libp2p-floodsub": "^0.24.0",
"libp2p-gossipsub": "^0.7.0",
"libp2p-kad-dht": "^0.20.0",
"libp2p-mdns": "^0.15.0",
"libp2p-mplex": "^0.10.1",
Expand Down
5 changes: 1 addition & 4 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ const DefaultConfig = {
autoDial: true
},
pubsub: {
enabled: true,
emitSelf: true,
signMessages: true,
strictSigning: true
enabled: true
},
relay: {
enabled: true,
Expand Down

0 comments on commit 9205fce

Please sign in to comment.