fix: return default pubsub topic, and add more logs

This commit is contained in:
Richard Ramos 2023-08-25 13:02:13 -04:00 committed by richΛrd
parent 3837428384
commit d62a5736a5
3 changed files with 7 additions and 9 deletions

View File

@ -1 +1 @@
0.165.2
0.165.3

View File

@ -673,11 +673,5 @@ func (t *Transport) StorePubsubTopicKey(topic string, privKey *ecdsa.PrivateKey)
}
func GetPubsubTopic(communityID []byte) string {
// TODO: remove hardcoded pubsub topic and use shard
result := "/waku/2/status-signed-test-1"
if communityID == nil {
result = relay.DefaultWakuTopic
}
return result
return relay.DefaultWakuTopic
}

View File

@ -1230,6 +1230,8 @@ func (w *Waku) Start() error {
return fmt.Errorf("failed to start go-waku node: %v", err)
}
w.logger.Info("WakuV2 PeerID", zap.Stringer("id", w.node.Host().ID()))
idService, err := identify.NewIDService(w.node.Host())
if err != nil {
return err
@ -1833,7 +1835,7 @@ func (w *Waku) subscribeToFilter(f *common.Filter) error {
for i := 0; i < len(peers) && i < w.settings.MinPeersForFilter; i++ {
subDetails, err := w.node.FilterLightnode().Subscribe(w.ctx, contentFilter, filter.WithPeer(peers[i]))
if err != nil {
w.logger.Warn("could not add wakuv2 filter for peer", zap.Any("peer", peers[i]))
w.logger.Warn("could not add wakuv2 filter for peer", zap.Stringer("peer", peers[i]))
continue
}
@ -1844,6 +1846,8 @@ func (w *Waku) subscribeToFilter(f *common.Filter) error {
}
subMap[subDetails.ID] = subDetails
go w.runFilterSubscriptionLoop(subDetails)
w.logger.Info("wakuv2 filter subscription success", zap.Stringer("peer", peers[i]), zap.String("pubsubTopic", contentFilter.Topic), zap.Strings("contentTopics", contentFilter.ContentTopics))
}
} else {