mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-03 22:43:09 +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.
|
## Status: Implemented.
|
||||||
##
|
##
|
||||||
let
|
let
|
||||||
|
rng = crypto.newRng()
|
||||||
hostAddress = tcpEndPoint(bindIp, bindPort)
|
hostAddress = tcpEndPoint(bindIp, bindPort)
|
||||||
announcedAddresses = if extIp.isNone() or extPort.isNone(): @[]
|
announcedAddresses = if extIp.isNone() or extPort.isNone(): @[]
|
||||||
else: @[tcpEndPoint(extIp.get(), extPort.get())]
|
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?
|
# XXX: Add this when we create node or start it?
|
||||||
peerInfo.addrs.add(hostAddress)
|
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
|
# TODO Untested - verify behavior after switch interface change
|
||||||
# More like this:
|
# More like this:
|
||||||
# let pubsub = GossipSub.init(
|
# let pubsub = GossipSub.init(
|
||||||
@ -88,7 +90,7 @@ proc init*(T: type WakuNode, nodeKey: crypto.PrivateKey,
|
|||||||
|
|
||||||
result = WakuNode(
|
result = WakuNode(
|
||||||
switch: switch,
|
switch: switch,
|
||||||
rng: crypto.newRng(),
|
rng: rng,
|
||||||
peerInfo: peerInfo,
|
peerInfo: peerInfo,
|
||||||
wakuRelay: wakuRelay,
|
wakuRelay: wakuRelay,
|
||||||
subscriptions: newTable[string, MessageNotificationSubscription](),
|
subscriptions: newTable[string, MessageNotificationSubscription](),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user