From 206de4c1e8674bc5541c6da3b70cae24c2688b4f Mon Sep 17 00:00:00 2001 From: LNSD Date: Tue, 18 Oct 2022 12:37:10 +0000 Subject: [PATCH] deploy: b139692b05e3b80bb2365e32d9a19e9a65ff7a25 --- .../vendor/libbacktrace-upstream/libtool | 2 +- waku/v2/node/config.nim | 23 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool b/vendor/nim-libbacktrace/vendor/libbacktrace-upstream/libtool index 04d71fbd7..fe61640a6 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-az243-417: +# Libtool was configured on host fv-az186-171: # 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/config.nim b/waku/v2/node/config.nim index a77971889..9f9fa8702 100644 --- a/waku/v2/node/config.nim +++ b/waku/v2/node/config.nim @@ -1,14 +1,15 @@ import std/strutils, - confutils, confutils/defs, confutils/std/net, + confutils, + confutils/defs, + confutils/std/net, confutils/toml/defs as confTomlDefs, confutils/toml/std/net as confTomlNet, - chronicles, chronos, + chronicles, + chronos, libp2p/crypto/crypto, libp2p/crypto/secp, - nimcrypto/utils, - eth/keys, - ../protocol/waku_message + nimcrypto/utils export confTomlDefs, @@ -34,11 +35,11 @@ type nodekey* {. desc: "P2P node private key as 64 char hex string.", - defaultValue: crypto.PrivateKey.random(Secp256k1, crypto.newRng()[]).tryGet() - name: "nodekey" }: crypto.PrivateKey + defaultValue: defaultPrivateKey() + name: "nodekey" }: PrivateKey listenAddress* {. - defaultValue: defaultListenAddress(config) + defaultValue: defaultListenAddress() desc: "Listening address for LibP2P (and Discovery v5, if enabled) traffic." name: "listen-address"}: ValidIpAddress @@ -136,7 +137,7 @@ type rlnRelayContentTopic* {. desc: "the pubsub topic for which rln-relay gets enabled", defaultValue: "/toy-chat/2/luzhou/proto" - name: "rln-relay-content-topic" }: ContentTopic + name: "rln-relay-content-topic" }: string rlnRelayDynamic* {. desc: "Enable waku-rln-relay with on-chain dynamic group management: true|false", @@ -458,11 +459,13 @@ proc parseCmdArg*(T: type Port, p: TaintedString): T = proc completeCmdArg*(T: type Port, val: TaintedString): seq[string] = return @[] -func defaultListenAddress*(conf: WakuNodeConf): ValidIpAddress = +proc defaultListenAddress*(): ValidIpAddress = # TODO: How should we select between IPv4 and IPv6 # Maybe there should be a config option for this. (static ValidIpAddress.init("0.0.0.0")) +proc defaultPrivateKey*(): PrivateKey = + crypto.PrivateKey.random(Secp256k1, crypto.newRng()[]).value proc readValue*(r: var TomlReader, val: var crypto.PrivateKey) {.raises: [Defect, IOError, SerializationError].} =