mirror of
https://github.com/logos-messaging/logos-delivery.git
synced 2026-04-14 20:23:08 +00:00
feat: integrate mix protocol with extended kademlia discovery
This commit is contained in:
parent
0b86093247
commit
98e51d803d
@ -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()
|
||||
|
||||
@ -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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user