add 1.1 protocol to gossip

This commit is contained in:
Giovanni Petrantoni 2020-06-23 11:49:14 +09:00
parent 3568b073fd
commit 9eb240fb7d
1 changed files with 5 additions and 2 deletions

View File

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