mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-14 00:46:44 +00:00
feat(bindings): generate a random private key (#2446)
This commit is contained in:
parent
501c92e2c3
commit
56ff30ca75
@ -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.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user