From b93bc084c0b58e85a94131a61192e893af62c641 Mon Sep 17 00:00:00 2001 From: jm-clius Date: Fri, 15 Jan 2021 07:51:56 +0000 Subject: [PATCH] deploy: 76c0d2b8396a0f5dc7b2f243b002685dee878d98 --- tests/v2/test_jsonrpc_waku.nim | 2 +- .../vendor/libbacktrace-upstream/config.log | 10 +++++----- .../vendor/libbacktrace-upstream/libtool | 2 +- waku/v2/node/wakunode2.nim | 15 +++++++++++---- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/tests/v2/test_jsonrpc_waku.nim b/tests/v2/test_jsonrpc_waku.nim index dd4caba2c..699bf396e 100644 --- a/tests/v2/test_jsonrpc_waku.nim +++ b/tests/v2/test_jsonrpc_waku.nim @@ -59,7 +59,7 @@ procSuite "Waku v2 JSON-RPC API": let response = await client.get_waku_v2_debug_v1_info() check: - response.listenStr == $node.peerInfo.addrs[0] & "/p2p/" & $node.peerInfo.peerId + response.listenStr == $node.peerInfo.addrs[^1] & "/p2p/" & $node.peerInfo.peerId server.stop() server.close() diff --git a/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/config.log b/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/config.log index 5a98d76e8..ce6c67098 100644 --- a/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/config.log +++ b/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/config.log @@ -10,11 +10,11 @@ generated by GNU Autoconf 2.69. Invocation command line was ## Platform. ## ## --------- ## -hostname = fv-az54-194 +hostname = fv-az56-274 uname -m = x86_64 -uname -r = 5.4.0-1032-azure +uname -r = 5.4.0-1036-azure uname -s = Linux -uname -v = #33~18.04.1-Ubuntu SMP Tue Nov 17 11:40:52 UTC 2020 +uname -v = #38~18.04.1-Ubuntu SMP Wed Jan 6 18:26:30 UTC 2021 /usr/bin/uname -p = unknown /bin/uname -X = unknown @@ -841,7 +841,7 @@ configure:12482: $? = 0 configure:12482: result: yes configure:12499: checking for getexecname configure:12499: gcc -o conftest -g -O3 -std=gnu11 -pipe -Wall -Wextra -fPIC conftest.c >&5 -/tmp/ccQp3htc.o: In function `main': +/tmp/cc5d7aku.o: In function `main': /home/runner/work/nim-waku/nim-waku/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/conftest.c:73: undefined reference to `getexecname' collect2: error: ld returned 1 exit status configure:12499: $? = 1 @@ -1134,7 +1134,7 @@ generated by GNU Autoconf 2.69. Invocation command line was CONFIG_COMMANDS = $ ./config.status -on fv-az54-194 +on fv-az56-274 config.status:1150: creating Makefile config.status:1150: creating backtrace-supported.h diff --git a/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool b/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool index b91a1a276..c15b1c114 100755 --- a/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool +++ b/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool @@ -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-az54-194: +# Libtool was configured on host fv-az56-274: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, diff --git a/waku/v2/node/wakunode2.nim b/waku/v2/node/wakunode2.nim index b1506dde9..fb4694c37 100644 --- a/waku/v2/node/wakunode2.nim +++ b/waku/v2/node/wakunode2.nim @@ -120,7 +120,9 @@ proc init*(T: type WakuNode, nodeKey: crypto.PrivateKey, info "Initializing networking", hostAddress, announcedAddresses # XXX: Add this when we create node or start it? - peerInfo.addrs.add(hostAddress) + peerInfo.addrs.add(hostAddress) # Index 0 + for multiaddr in announcedAddresses: + peerInfo.addrs.add(multiaddr) # Announced addresses in index > 0 var switch = newStandardSwitch(some(nodekey), hostAddress, transportFlags = {ServerFlags.ReuseAddr}, rng = rng) @@ -149,7 +151,7 @@ proc start*(node: WakuNode) {.async.} = # TODO Get this from WakuNode obj let peerInfo = node.peerInfo info "PeerInfo", peerId = peerInfo.peerId, addrs = peerInfo.addrs - let listenStr = $peerInfo.addrs[0] & "/p2p/" & $peerInfo.peerId + let listenStr = $peerInfo.addrs[^1] & "/p2p/" & $peerInfo.peerId ## XXX: this should be /ip4..., / stripped? info "Listening on", full = listenStr @@ -259,7 +261,7 @@ proc info*(node: WakuNode): WakuInfo = # TODO Generalize this for other type of multiaddresses let peerInfo = node.peerInfo - let listenStr = $peerInfo.addrs[0] & "/p2p/" & $peerInfo.peerId + let listenStr = $peerInfo.addrs[^1] & "/p2p/" & $peerInfo.peerId let wakuInfo = WakuInfo(listenStr: listenStr) return wakuInfo @@ -455,8 +457,13 @@ when isMainModule: (extIp, extTcpPort, extUdpPort) = setupNat(conf.nat, clientId, Port(uint16(conf.tcpPort) + conf.portsShift), Port(uint16(conf.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. + extPort = if extIp.isSome() and extTcpPort.isNone(): some(Port(uint16(conf.tcpPort) + conf.portsShift)) + else: extTcpPort node = WakuNode.init(conf.nodeKey, conf.listenAddress, - Port(uint16(conf.tcpPort) + conf.portsShift), extIp, extTcpPort) + Port(uint16(conf.tcpPort) + conf.portsShift), extIp, extPort) waitFor node.start()