diff --git a/cmd/waku/node.go b/cmd/waku/node.go index 92da475e..648fc213 100644 --- a/cmd/waku/node.go +++ b/cmd/waku/node.go @@ -478,7 +478,7 @@ func processTopics(options NodeOptions) (map[string][]string, error) { pubSubTopicMap[pTopic.String()] = append(pubSubTopicMap[pTopic.String()], cTopic) } //If no topics are passed, then use default waku topic. - if len(pubSubTopicMap) == 0 { + if len(pubSubTopicMap) == 0 && options.ClusterID == 0 { pubSubTopicMap[relay.DefaultWakuTopic] = []string{} } diff --git a/cmd/waku/server/rest/admin.go b/cmd/waku/server/rest/admin.go index 1e719e1d..f945c681 100644 --- a/cmd/waku/server/rest/admin.go +++ b/cmd/waku/server/rest/admin.go @@ -105,7 +105,7 @@ func (a *AdminService) postV1Peer(w http.ResponseWriter, req *http.Request) { } for _, shard := range pInfo.Shards { - topic := waku_proto.NewStaticShardingPubsubTopic(waku_proto.ClusterIndex, uint16(shard)) + topic := waku_proto.NewStaticShardingPubsubTopic(a.node.ClusterID(), uint16(shard)) topics = append(topics, topic.String()) } diff --git a/waku/v2/node/wakunode2.go b/waku/v2/node/wakunode2.go index a499ab71..5faf5435 100644 --- a/waku/v2/node/wakunode2.go +++ b/waku/v2/node/wakunode2.go @@ -978,3 +978,7 @@ func GetDiscv5Option(dnsDiscoveredNodes []dnsdisc.DiscoveredNode, discv5Nodes [] return WithDiscoveryV5(port, bootnodes, autoUpdate), nil } + +func (w *WakuNode) ClusterID() uint16 { + return w.opts.clusterID +}