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
}
}
})