From d717318e712ff899fb2be0ac6138d7d078628f39 Mon Sep 17 00:00:00 2001 From: ChronosX88 Date: Thu, 22 Oct 2020 18:36:15 +0400 Subject: [PATCH] Change from floodsub to gossipsub pubsub algorithm in pubsub route --- pb/pubsub_router.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pb/pubsub_router.go b/pb/pubsub_router.go index 9068c85..dcc886e 100644 --- a/pb/pubsub_router.go +++ b/pb/pubsub_router.go @@ -7,7 +7,6 @@ import ( "github.com/Secured-Finance/dione/models" host "github.com/libp2p/go-libp2p-core/host" peer "github.com/libp2p/go-libp2p-core/peer" - "github.com/libp2p/go-libp2p-core/protocol" pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/sirupsen/logrus" ) @@ -31,9 +30,9 @@ func NewPubSubRouter(h host.Host, oracleTopic string) *PubSubRouter { handlers: make(map[string][]Handler), } - pb, err := pubsub.NewFloodsubWithProtocols( + pb, err := pubsub.NewGossipSub( context.TODO(), - psr.node, []protocol.ID{"/dione/1.0.0"}, //pubsub.WithMessageSigning(true), + psr.node, //pubsub.WithMessageSigning(true), //pubsub.WithStrictSignatureVerification(true), ) if err != nil {