fix: fail to start switch with ext ip (#1181)

This commit is contained in:
Hanno Cornelius 2022-09-23 15:27:15 +01:00 committed by GitHub
parent ca1718c504
commit 6b86c4a22a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -760,7 +760,10 @@ proc start*(node: WakuNode) {.async.} =
##
## Status: Implemented.
# TODO Get this from WakuNode obj
## NB: careful when moving this. We need to start the switch with the bind address
## BEFORE updating with announced addresses for the sake of identify.
await node.switch.start()
let peerInfo = node.switch.peerInfo
info "PeerInfo", peerId = peerInfo.peerId, addrs = peerInfo.addrs
var listenStr = ""
@ -772,14 +775,13 @@ proc start*(node: WakuNode) {.async.} =
info "Listening on", full = listenStr
info "DNS: discoverable ENR ", enr = node.enr.toUri()
## Update switch peer info with announced addrs
node.updateSwitchPeerInfo()
# Perform relay-specific startup tasks TODO: this should be rethought
if not node.wakuRelay.isNil:
await node.startRelay()
## Update switch peer info with announced addrs
node.updateSwitchPeerInfo()
await node.switch.start()
node.started = true
info "Node started successfully"