Add empty talkreq command to dcli

This commit is contained in:
kdeme 2020-11-13 12:45:39 +01:00
parent 784a868705
commit 18430ef127
No known key found for this signature in database
GPG Key ID: 4E8DD21420AF43F5
1 changed files with 12 additions and 0 deletions

View File

@ -9,6 +9,7 @@ type
noCommand
ping
findnode
talkreq
DiscoveryConf* = object
logLevel* {.
@ -71,6 +72,11 @@ type
argument
desc: "ENR URI of the node to send a findNode message"
name: "node" .}: Node
of talkreq:
talkreqTarget* {.
argument
desc: "ENR URI of the node to send a talkreq message"
name: "node" .}: Node
proc parseCmdArg*(T: type enr.Record, p: TaintedString): T =
if not fromURI(result, p):
@ -173,6 +179,12 @@ proc run(config: DiscoveryConf) =
echo $node.record & " - " & shortLog(node)
else:
echo "No Nodes message returned"
of talkreq:
let talkresp = waitFor d.talkreq(config.talkreqTarget, @[], @[])
if talkresp.isOk():
echo talkresp[]
else:
echo "No Talk Response message returned"
of noCommand:
d.start()
runForever()