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
This commit is contained in:
Vasco Santos 2020-11-13 15:14:21 +01:00 committed by Vasco Santos
parent 49fffda23c
commit e50c6abcf2
3 changed files with 8 additions and 10 deletions

View File

@ -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],
@ -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
}
}
})

View File

@ -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",
@ -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",

View File

@ -54,10 +54,7 @@ const DefaultConfig = {
autoDial: true
},
pubsub: {
enabled: true,
emitSelf: true,
signMessages: true,
strictSigning: true
enabled: true
},
relay: {
enabled: true,