From 9eb240fb7d121a9f5274cbcfb95e16b09969bd4d Mon Sep 17 00:00:00 2001 From: Giovanni Petrantoni Date: Tue, 23 Jun 2020 11:49:14 +0900 Subject: [PATCH] add 1.1 protocol to gossip --- libp2p/protocols/pubsub/gossipsub.nim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libp2p/protocols/pubsub/gossipsub.nim b/libp2p/protocols/pubsub/gossipsub.nim index 85bff0f59..4982723d1 100644 --- a/libp2p/protocols/pubsub/gossipsub.nim +++ b/libp2p/protocols/pubsub/gossipsub.nim @@ -26,7 +26,9 @@ import pubsub, logScope: topics = "gossipsub" -const GossipSubCodec* = "/meshsub/1.0.0" +const + GossipSubCodec* = "/meshsub/1.0.0" + GossipSubCodec_11* = "/meshsub/1.1.0" # overlay parameters const GossipSubD* = 6 @@ -71,7 +73,8 @@ method init*(g: GossipSub) = await g.handleConn(conn, proto) g.handler = handler - g.codec = GossipSubCodec + g.codecs &= GossipSubCodec + g.codecs &= GossipSubCodec_11 proc replenishFanout(g: GossipSub, topic: string) {.async.} = ## get fanout peers for a topic