implementing comments

This commit is contained in:
Gabriel mermelstein 2024-05-31 16:06:46 +02:00
parent d5132edfe1
commit 32675a8471
No known key found for this signature in database
GPG Key ID: 82B8134785FEAE0D
2 changed files with 1 additions and 12 deletions

View File

@ -117,16 +117,10 @@ proc setupProtocols(
## Optionally include persistent message storage.
## No protocols are started yet.
var shardCount: uint32
if conf.pubsubTopics.len > 0:
shardCount = uint32(conf.pubsubTopics.len)
else:
shardCount = uint32(conf.shards.len)
node.mountMetadata(conf.clusterId).isOkOr:
return err("failed to mount waku metadata protocol: " & error)
node.mountSharding(conf.clusterId, shardCount).isOkOr:
node.mountSharding(conf.clusterId, uint32(conf.pubsubTopics.len)).isOkOr:
return err("failed to mount waku sharding: " & error)
# Mount relay on all nodes

View File

@ -348,11 +348,6 @@ proc onConnEvent(pm: PeerManager, peerId: PeerID, event: ConnEvent) {.async.} =
discard
proc onPeerMetadata(pm: PeerManager, peerId: PeerId) {.async.} =
# To prevent metadata protocol from breaking prev nodes, by now we only
# disconnect if the clusterid is specified.
if pm.wakuMetadata.clusterId == 0:
return
let res = catch:
await pm.switch.dial(peerId, WakuMetadataCodec)