diff --git a/beacon_chain/eth2_discovery.nim b/beacon_chain/eth2_discovery.nim index cad73ae02..5bb99b511 100644 --- a/beacon_chain/eth2_discovery.nim +++ b/beacon_chain/eth2_discovery.nim @@ -16,7 +16,7 @@ export proc new*(T: type Eth2DiscoveryProtocol, conf: BeaconNodeConf, - rawPrivKeyBytes: openarray[byte]): T = + ip: IpAddress, rawPrivKeyBytes: openarray[byte]): T = # TODO # Implement more configuration options: # * for setting up a specific key @@ -25,7 +25,7 @@ proc new*(T: type Eth2DiscoveryProtocol, pk = initPrivateKey(rawPrivKeyBytes) db = DiscoveryDB.init(newMemoryDB()) - newProtocol(pk, db, Port conf.tcpPort, Port conf.udpPort) + newProtocol(pk, db, ip, Port conf.tcpPort, Port conf.udpPort) proc toENode*(a: MultiAddress): Result[ENode, cstring] = if not IPFS.match(a): diff --git a/beacon_chain/eth2_network.nim b/beacon_chain/eth2_network.nim index 980a6bd6f..6ca712e70 100644 --- a/beacon_chain/eth2_network.nim +++ b/beacon_chain/eth2_network.nim @@ -156,7 +156,7 @@ when networkBackend in [libp2p, libp2pDaemon]: # are running behind a NAT). var switch = newStandardSwitch(some keys.seckey, hostAddress, triggerSelf = true, gossip = false) - result = Eth2Node.init(conf, switch, keys.seckey.asEthKey) + result = Eth2Node.init(conf, switch, extIp, keys.seckey.asEthKey) else: let keyFile = conf.ensureNetworkIdFile diff --git a/beacon_chain/libp2p_backend.nim b/beacon_chain/libp2p_backend.nim index cd1ced58e..f6c17d74f 100644 --- a/beacon_chain/libp2p_backend.nim +++ b/beacon_chain/libp2p_backend.nim @@ -220,11 +220,11 @@ proc runDiscoveryLoop*(node: Eth2Node) {.async.} = await sleepAsync seconds(1) proc init*(T: type Eth2Node, conf: BeaconNodeConf, - switch: Switch, privKey: keys.PrivateKey): T = + switch: Switch, ip: IpAddress, privKey: keys.PrivateKey): T = new result result.switch = switch result.peers = initTable[PeerID, Peer]() - result.discovery = Eth2DiscoveryProtocol.new(conf, privKey.data) + result.discovery = Eth2DiscoveryProtocol.new(conf, ip, privKey.data) result.wantedPeers = conf.maxPeers newSeq result.protocolStates, allProtocols.len diff --git a/vendor/nim-chronicles b/vendor/nim-chronicles index f1acc470e..b9315ced4 160000 --- a/vendor/nim-chronicles +++ b/vendor/nim-chronicles @@ -1 +1 @@ -Subproject commit f1acc470eb01a4d9086e752d103a73e49a372eaf +Subproject commit b9315ced4e2d7926737dab73b2374543088e17fd diff --git a/vendor/nim-eth b/vendor/nim-eth index 5aebab3f4..74d0247e6 160000 --- a/vendor/nim-eth +++ b/vendor/nim-eth @@ -1 +1 @@ -Subproject commit 5aebab3f41834505af7c694f8caf2e8c9c5716cc +Subproject commit 74d0247e6b69bf45d4e53c27e0089d5bb35b29ed diff --git a/vendor/nim-faststreams b/vendor/nim-faststreams index e7a34b74f..5fb40e4ff 160000 --- a/vendor/nim-faststreams +++ b/vendor/nim-faststreams @@ -1 +1 @@ -Subproject commit e7a34b74f298eaabd7bdbe2f080bf9747ed6bfd9 +Subproject commit 5fb40e4ffd2c5a7eca88203d99150e2d99732e41