mirror of https://github.com/status-im/nim-eth.git
Add empty talkreq command to dcli
This commit is contained in:
parent
784a868705
commit
18430ef127
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue