adding discv5Discovery param

This commit is contained in:
Gabriel mermelstein 2024-10-08 16:29:15 +03:00
parent 4fa26147e8
commit a4ac3278f0
No known key found for this signature in database
GPG Key ID: 82B8134785FEAE0D
2 changed files with 5 additions and 3 deletions

View File

@ -1676,7 +1676,8 @@ type WakuConfig struct {
DnsDiscovery string `json:"dnsDiscovery,omitempty"` DnsDiscovery string `json:"dnsDiscovery,omitempty"`
DnsDiscoveryUrl string `json:"dnsDiscoveryUrl,omitempty"` DnsDiscoveryUrl string `json:"dnsDiscoveryUrl,omitempty"`
MaxMessageSize string `json:"maxMessageSize,omitempty"` MaxMessageSize string `json:"maxMessageSize,omitempty"`
DiscV5BootstrapNodes []string `json:"discv5BootstrapNodes,omitempty"` Discv5BootstrapNodes []string `json:"discv5BootstrapNodes,omitempty"`
Discv5Discovery bool `json:"discv5Discovery,omitempty"`
} }
type Waku struct { type Waku struct {
@ -1834,7 +1835,7 @@ func wakuNew(nodeKey *ecdsa.PrivateKey,
timesource: ts, timesource: ts,
storeMsgIDsMu: sync.RWMutex{}, storeMsgIDsMu: sync.RWMutex{},
logger: logger, logger: logger,
discV5BootstrapNodes: cfg.DiscV5BootstrapNodes, discV5BootstrapNodes: cfg.Discv5BootstrapNodes,
onHistoricMessagesRequestFailed: onHistoricMessagesRequestFailed, onHistoricMessagesRequestFailed: onHistoricMessagesRequestFailed,
onPeerStats: onPeerStats, onPeerStats: onPeerStats,
onlineChecker: onlinechecker.NewDefaultOnlineChecker(false).(*onlinechecker.DefaultOnlineChecker), onlineChecker: onlinechecker.NewDefaultOnlineChecker(false).(*onlinechecker.DefaultOnlineChecker),

View File

@ -190,7 +190,8 @@ func TestBasicWakuV2(t *testing.T) {
NodeKey: "11d0dcea28e86f81937a3bd1163473c7fbc0a0db54fd72914849bc47bdf78710", NodeKey: "11d0dcea28e86f81937a3bd1163473c7fbc0a0db54fd72914849bc47bdf78710",
EnableRelay: true, EnableRelay: true,
LogLevel: "DEBUG", LogLevel: "DEBUG",
DiscV5BootstrapNodes: []string{nwakuInfo.EnrUri}, Discv5BootstrapNodes: []string{nwakuInfo.EnrUri},
Discv5Discovery: true,
} }
w, err := New(nil, "", &nwakuConfig, nil, nil, nil, nil, nil) w, err := New(nil, "", &nwakuConfig, nil, nil, nil, nil, nil)