mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-22 03:08:30 +00:00
Let also discovery used listen-address cli option instead of always any address (#1658)
This commit is contained in:
parent
61568e4335
commit
23bec99341
@ -97,9 +97,9 @@ type
|
|||||||
desc: "Specifies a line-delimited file of bootstrap Ethereum network addresses"
|
desc: "Specifies a line-delimited file of bootstrap Ethereum network addresses"
|
||||||
name: "bootstrap-file" }: InputFile
|
name: "bootstrap-file" }: InputFile
|
||||||
|
|
||||||
libp2pAddress* {.
|
listenAddress* {.
|
||||||
defaultValue: defaultListenAddress(config)
|
defaultValue: defaultListenAddress(config)
|
||||||
desc: "Listening address for the Ethereum LibP2P traffic"
|
desc: "Listening address for the Ethereum LibP2P and Discovery v5 traffic"
|
||||||
name: "listen-address" }: ValidIpAddress
|
name: "listen-address" }: ValidIpAddress
|
||||||
|
|
||||||
tcpPort* {.
|
tcpPort* {.
|
||||||
|
@ -89,5 +89,5 @@ proc new*(T: type Eth2DiscoveryProtocol,
|
|||||||
if fileExists(persistentBootstrapFile):
|
if fileExists(persistentBootstrapFile):
|
||||||
loadBootstrapFile(persistentBootstrapFile, bootstrapEnrs)
|
loadBootstrapFile(persistentBootstrapFile, bootstrapEnrs)
|
||||||
|
|
||||||
newProtocol(
|
newProtocol(pk, ip, tcpPort, udpPort, enrFields, bootstrapEnrs,
|
||||||
pk, ip, tcpPort, udpPort, enrFields, bootstrapEnrs, rng = rng)
|
bindIp = conf.listenAddress, rng = rng)
|
||||||
|
@ -1228,7 +1228,7 @@ proc createEth2Node*(
|
|||||||
enrForkId: ENRForkID): Eth2Node =
|
enrForkId: ENRForkID): Eth2Node =
|
||||||
var
|
var
|
||||||
(extIp, extTcpPort, extUdpPort) = setupNat(conf)
|
(extIp, extTcpPort, extUdpPort) = setupNat(conf)
|
||||||
hostAddress = tcpEndPoint(conf.libp2pAddress, conf.tcpPort)
|
hostAddress = tcpEndPoint(conf.listenAddress, conf.tcpPort)
|
||||||
announcedAddresses = if extIp.isNone(): @[]
|
announcedAddresses = if extIp.isNone(): @[]
|
||||||
else: @[tcpEndPoint(extIp.get(), extTcpPort)]
|
else: @[tcpEndPoint(extIp.get(), extTcpPort)]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user