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
|
noCommand
|
||||||
ping
|
ping
|
||||||
findnode
|
findnode
|
||||||
|
talkreq
|
||||||
|
|
||||||
DiscoveryConf* = object
|
DiscoveryConf* = object
|
||||||
logLevel* {.
|
logLevel* {.
|
||||||
|
@ -71,6 +72,11 @@ type
|
||||||
argument
|
argument
|
||||||
desc: "ENR URI of the node to send a findNode message"
|
desc: "ENR URI of the node to send a findNode message"
|
||||||
name: "node" .}: Node
|
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 =
|
proc parseCmdArg*(T: type enr.Record, p: TaintedString): T =
|
||||||
if not fromURI(result, p):
|
if not fromURI(result, p):
|
||||||
|
@ -173,6 +179,12 @@ proc run(config: DiscoveryConf) =
|
||||||
echo $node.record & " - " & shortLog(node)
|
echo $node.record & " - " & shortLog(node)
|
||||||
else:
|
else:
|
||||||
echo "No Nodes message returned"
|
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:
|
of noCommand:
|
||||||
d.start()
|
d.start()
|
||||||
runForever()
|
runForever()
|
||||||
|
|
Loading…
Reference in New Issue