mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-02 14:03:06 +00:00
Pass ReuseAddr flag for wakunode2 (#223)
This commit is contained in:
parent
bef916b31c
commit
cae31bd09b
@ -59,6 +59,7 @@ proc init*(T: type WakuNode, nodeKey: crypto.PrivateKey,
|
||||
## Status: Implemented.
|
||||
##
|
||||
let
|
||||
rng = crypto.newRng()
|
||||
hostAddress = tcpEndPoint(bindIp, bindPort)
|
||||
announcedAddresses = if extIp.isNone() or extPort.isNone(): @[]
|
||||
else: @[tcpEndPoint(extIp.get(), extPort.get())]
|
||||
@ -68,7 +69,8 @@ proc init*(T: type WakuNode, nodeKey: crypto.PrivateKey,
|
||||
# XXX: Add this when we create node or start it?
|
||||
peerInfo.addrs.add(hostAddress)
|
||||
|
||||
var switch = newStandardSwitch(some(nodekey), hostAddress)
|
||||
var switch = newStandardSwitch(some(nodekey), hostAddress,
|
||||
transportFlags = {ServerFlags.ReuseAddr}, rng = rng)
|
||||
# TODO Untested - verify behavior after switch interface change
|
||||
# More like this:
|
||||
# let pubsub = GossipSub.init(
|
||||
@ -88,7 +90,7 @@ proc init*(T: type WakuNode, nodeKey: crypto.PrivateKey,
|
||||
|
||||
result = WakuNode(
|
||||
switch: switch,
|
||||
rng: crypto.newRng(),
|
||||
rng: rng,
|
||||
peerInfo: peerInfo,
|
||||
wakuRelay: wakuRelay,
|
||||
subscriptions: newTable[string, MessageNotificationSubscription](),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user