feat: integrate mix protocol with extended kademlia discovery

This commit is contained in:
Prem Chaitanya Prathi 2026-02-13 18:00:05 +05:30
parent 0b86093247
commit 98e51d803d
No known key found for this signature in database
2 changed files with 6 additions and 1 deletions

View File

@ -1145,4 +1145,7 @@ proc toWakuConf*(n: WakuNodeConf): ConfResult[WakuConf] =
of WakuMode.noMode:
discard # use explicit CLI flags as-is
b.kademliaDiscoveryConf.withEnabled(n.enableKadDiscovery)
b.kademliaDiscoveryConf.withBootstrapNodes(n.kadBootstrapNodes)
return b.build()

View File

@ -194,7 +194,7 @@ proc runDiscoveryLoop(
info "extended kademlia discovery loop started", interval = interval
try:
while true:
while wk.running:
# Wait for node to be started
if not wk.isNodeStarted.isNil() and not wk.isNodeStarted():
await sleepAsync(ExtendedKademliaDiscoveryStartupDelay)
@ -258,6 +258,8 @@ proc start*(
except CatchableError as e:
return err("failed to start kademlia discovery: " & e.msg)
wk.running = true
wk.discoveryLoop = wk.runDiscoveryLoop(interval, minMixPeers)
info "kademlia discovery started"