fix: set waku version to mailservers and set min peers for relay to 1

This commit is contained in:
Richard Ramos 2022-11-03 08:55:47 -04:00 committed by RichΛrd
parent c528660aa3
commit cd34538937
3 changed files with 6 additions and 4 deletions

View File

@ -183,6 +183,7 @@ func (m *Messenger) allMailservers() ([]mailservers.Mailserver, error) {
for _, c := range customMailservers {
if c.Fleet == fleet {
c.Version = m.transport.WakuVersion()
allMailservers = append(allMailservers, c)
}
}
@ -669,6 +670,7 @@ func (m *Messenger) getPinnedMailserver() (*mailservers.Mailserver, error) {
for _, c := range customMailservers {
if c.Fleet == fleet && c.ID == pinnedMailserver {
c.Version = m.transport.WakuVersion()
return &c, nil
}
}

View File

@ -54,7 +54,7 @@ var DefaultConfig = Config{
Port: 60000,
KeepAliveInterval: 10, // second
DiscoveryLimit: 40,
MinPeersForRelay: 2, // TODO: determine correct value with Vac team
MinPeersForRelay: 1, // TODO: determine correct value with Vac team
UDPPort: 9000,
AutoUpdate: false,
}

View File

@ -868,15 +868,15 @@ func (w *Waku) broadcast() {
}
if w.settings.LightClient {
log.Debug("publishing message via lightpush", zap.Any("hash", hexutil.Encode(hash)))
log.Debug("publishing message via lightpush", "hash", hexutil.Encode(hash))
_, err = w.node.Lightpush().Publish(context.Background(), msg)
} else {
log.Debug("publishing message via relay", zap.Any("hash", hexutil.Encode(hash)))
log.Debug("publishing message via relay", "hash", hexutil.Encode(hash))
_, err = w.node.Relay().Publish(context.Background(), msg)
}
if err != nil {
log.Error("could not send message", zap.Any("hash", hexutil.Encode(hash)), zap.Error(err))
log.Error("could not send message", "hash", hexutil.Encode(hash), "err", zap.Error(err))
w.envelopeFeed.Send(common.EnvelopeEvent{
Hash: gethcommon.BytesToHash(hash),
Event: common.EventEnvelopeExpired,