From 438f2ecab2259bcca56a755448442f605b2ef9dd Mon Sep 17 00:00:00 2001 From: Oskar Thoren Date: Thu, 21 May 2020 12:16:58 +0800 Subject: [PATCH] Use config nodekey for deterministic node id from CLI --- waku/node/v2/wakunode.nim | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/waku/node/v2/wakunode.nim b/waku/node/v2/wakunode.nim index 0d1a6c745..080e10831 100644 --- a/waku/node/v2/wakunode.nim +++ b/waku/node/v2/wakunode.nim @@ -144,13 +144,10 @@ proc run(config: WakuNodeConf) = hostAddress = MultiAddress.init(DefaultAddr) # Difference between announced and host address relevant for running behind NAT, however doesn't seem like nim-libp2p supports this. GHI? - # - # TODO: Convert config.nodekey eth.key to libp2p.crypto key. Should work with Secp256k1, just need to ensure representation etc is the same. Using random now for spike. - #nodekey = config.nodekey - #keys = crypto.KeyPair(nodekey) - privKey = PrivateKey.random(Secp256k1) - keys = KeyPair(seckey: privKey, pubkey: privKey.getKey()) - peerInfo = PeerInfo.init(privKey) + # NOTE: This is a privatekey + nodekey = config.nodekey + keys = KeyPair(seckey: nodekey, pubkey: nodekey.getKey()) + peerInfo = PeerInfo.init(nodekey) info "Initializing networking (host address and announced same)", address