mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-14 17:04:53 +00:00
deploy: 83f71ae9057df92dd3cb6a977b40f634dcb94a3e
This commit is contained in:
parent
685d4c0663
commit
51949c7175
@ -18,7 +18,9 @@ proc runBackground() {.async.} =
|
||||
conf = WakuNodeConf.load()
|
||||
(extIp, extTcpPort, extUdpPort) = setupNat(conf.nat, clientId,
|
||||
Port(uint16(conf.tcpPort) + conf.portsShift),
|
||||
Port(uint16(conf.udpPort) + conf.portsShift))
|
||||
# This is actually a UDP port but we're only supplying this value
|
||||
# To satisfy the API.
|
||||
Port(uint16(conf.tcpPort) + conf.portsShift))
|
||||
node = WakuNode.new(conf.nodeKey, conf.listenAddress,
|
||||
Port(uint16(conf.tcpPort) + conf.portsShift), extIp, extTcpPort)
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# libtool - Provide generalized library-building support services.
|
||||
# Generated automatically by config.status (libbacktrace) version-unused
|
||||
# Libtool was configured on host fv-az129-926:
|
||||
# Libtool was configured on host fv-az132-413:
|
||||
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
|
||||
#
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
|
||||
|
@ -31,11 +31,6 @@ type
|
||||
defaultValue: 30303
|
||||
name: "devp2p-tcp-port" .}: uint16
|
||||
|
||||
udpPort* {.
|
||||
desc: "UDP listening port"
|
||||
defaultValue: 9000
|
||||
name: "udp-port" .}: uint16
|
||||
|
||||
portsShift* {.
|
||||
desc: "Add a shift to all default port numbers"
|
||||
defaultValue: 0
|
||||
|
@ -265,24 +265,28 @@ when isMainModule:
|
||||
if conf.logLevel != LogLevel.NONE:
|
||||
setLogLevel(conf.logLevel)
|
||||
|
||||
## `udpPort` is only supplied to satisfy underlying APIs but is not
|
||||
## actually a supported transport.
|
||||
let udpPort = conf.devp2pTcpPort
|
||||
|
||||
# Load address configuration
|
||||
let
|
||||
(nodev1ExtIp, _, _) = setupNat(conf.nat, ClientIdV1,
|
||||
Port(conf.devp2pTcpPort + conf.portsShift),
|
||||
Port(conf.udpPort + conf.portsShift))
|
||||
Port(udpPort + conf.portsShift))
|
||||
# TODO: EthereumNode should have a better split of binding address and
|
||||
# external address. Also, can't have different ports as it stands now.
|
||||
nodev1Address = if nodev1ExtIp.isNone():
|
||||
Address(ip: parseIpAddress("0.0.0.0"),
|
||||
tcpPort: Port(conf.devp2pTcpPort + conf.portsShift),
|
||||
udpPort: Port(conf.udpPort + conf.portsShift))
|
||||
udpPort: Port(udpPort + conf.portsShift))
|
||||
else:
|
||||
Address(ip: nodev1ExtIp.get(),
|
||||
tcpPort: Port(conf.devp2pTcpPort + conf.portsShift),
|
||||
udpPort: Port(conf.udpPort + conf.portsShift))
|
||||
udpPort: Port(udpPort + conf.portsShift))
|
||||
(nodev2ExtIp, nodev2ExtPort, _) = setupNat(conf.nat, clientId,
|
||||
Port(uint16(conf.libp2pTcpPort) + conf.portsShift),
|
||||
Port(uint16(conf.udpPort) + conf.portsShift))
|
||||
Port(uint16(udpPort) + conf.portsShift))
|
||||
|
||||
# Topic interest and bloom
|
||||
var topicInterest: Option[seq[waku_protocol.Topic]]
|
||||
|
@ -28,11 +28,6 @@ type
|
||||
defaultValue: 30303
|
||||
name: "tcp-port" .}: uint16
|
||||
|
||||
udpPort* {.
|
||||
desc: "UDP listening port."
|
||||
defaultValue: 30303
|
||||
name: "udp-port" .}: uint16
|
||||
|
||||
portsShift* {.
|
||||
desc: "Add a shift to all port numbers."
|
||||
defaultValue: 0
|
||||
|
@ -15,20 +15,23 @@ const clientId = "Nimbus waku node"
|
||||
|
||||
proc run(config: WakuNodeConf, rng: ref BrHmacDrbgContext)
|
||||
{.raises: [Defect, ValueError, RpcBindError, CatchableError, Exception]} =
|
||||
## `udpPort` is only supplied to satisfy underlying APIs but is not
|
||||
## actually a supported transport.
|
||||
let udpPort = config.tcpPort
|
||||
let
|
||||
(ipExt, tcpPortExt, udpPortExt) = setupNat(config.nat, clientId,
|
||||
(ipExt, tcpPortExt, _) = setupNat(config.nat, clientId,
|
||||
Port(config.tcpPort + config.portsShift),
|
||||
Port(config.udpPort + config.portsShift))
|
||||
Port(udpPort + config.portsShift))
|
||||
# TODO: EthereumNode should have a better split of binding address and
|
||||
# external address. Also, can't have different ports as it stands now.
|
||||
address = if ipExt.isNone():
|
||||
Address(ip: parseIpAddress("0.0.0.0"),
|
||||
tcpPort: Port(config.tcpPort + config.portsShift),
|
||||
udpPort: Port(config.udpPort + config.portsShift))
|
||||
udpPort: Port(udpPort + config.portsShift))
|
||||
else:
|
||||
Address(ip: ipExt.get(),
|
||||
tcpPort: Port(config.tcpPort + config.portsShift),
|
||||
udpPort: Port(config.udpPort + config.portsShift))
|
||||
udpPort: Port(udpPort + config.portsShift))
|
||||
|
||||
# Set-up node
|
||||
var node = newEthereumNode(config.nodekey, address, NetworkId(1), nil, clientId,
|
||||
|
@ -32,11 +32,6 @@ type
|
||||
defaultValue: 60000
|
||||
name: "tcp-port" }: Port
|
||||
|
||||
udpPort* {.
|
||||
desc: "UDP listening port."
|
||||
defaultValue: 60000
|
||||
name: "udp-port" }: Port
|
||||
|
||||
portsShift* {.
|
||||
desc: "Add a shift to all port numbers."
|
||||
defaultValue: 0
|
||||
|
@ -823,11 +823,14 @@ when isMainModule:
|
||||
## file. Optionally include persistent peer storage.
|
||||
## No protocols are mounted yet.
|
||||
|
||||
## `udpPort` is only supplied to satisfy underlying APIs but is not
|
||||
## actually a supported transport.
|
||||
let udpPort = conf.tcpPort
|
||||
let
|
||||
(extIp, extTcpPort, extUdpPort) = setupNat(conf.nat,
|
||||
clientId,
|
||||
Port(uint16(conf.tcpPort) + conf.portsShift),
|
||||
Port(uint16(conf.udpPort) + conf.portsShift))
|
||||
Port(uint16(udpPort) + conf.portsShift))
|
||||
## @TODO: the NAT setup assumes a manual port mapping configuration if extIp config is set. This probably
|
||||
## implies adding manual config item for extPort as well. The following heuristic assumes that, in absence of manual
|
||||
## config, the external port is the same as the bind port.
|
||||
|
Loading…
x
Reference in New Issue
Block a user