From 6de38551fe4ca04d2c7306807b36e48852748cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?rich=CE=9Brd?= Date: Tue, 20 Feb 2024 11:18:03 -0400 Subject: [PATCH] feat(bindings): generate a random private key (#2446) --- library/waku_thread/config.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/waku_thread/config.nim b/library/waku_thread/config.nim index c2f077fa6..b0565ef5f 100644 --- a/library/waku_thread/config.nim +++ b/library/waku_thread/config.nim @@ -17,8 +17,8 @@ proc parsePrivateKey(jsonNode: JsonNode, jsonResp: var JsonEvent): bool = if not jsonNode.contains("key"): - jsonResp = JsonErrorEvent.new("The node key is missing."); - return false + privateKey = PrivateKey.random(Secp256k1, newRng()[]).tryGet() + return true if jsonNode["key"].kind != JsonNodeKind.JString: jsonResp = JsonErrorEvent.new("The node key should be a string.");