deploy: 76c0d2b8396a0f5dc7b2f243b002685dee878d98

This commit is contained in:
jm-clius 2021-01-15 07:51:56 +00:00
parent ae43c4ad0b
commit b93bc084c0
4 changed files with 18 additions and 11 deletions

View File

@ -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()

View File

@ -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

View File

@ -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,

View File

@ -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()