2022-11-04 09:52:27 +00:00
|
|
|
when (NimMajor, NimMinor) < (1, 4):
|
|
|
|
{.push raises: [Defect].}
|
|
|
|
else:
|
|
|
|
{.push raises: [].}
|
2021-07-22 08:43:41 +00:00
|
|
|
|
2020-11-27 07:18:48 +00:00
|
|
|
import
|
2021-06-09 14:37:08 +00:00
|
|
|
chronicles,
|
2020-11-27 07:18:48 +00:00
|
|
|
json_rpc/rpcserver,
|
2022-10-18 14:05:53 +00:00
|
|
|
../waku_node
|
2020-11-27 07:18:48 +00:00
|
|
|
|
2021-03-23 08:04:51 +00:00
|
|
|
logScope:
|
2022-11-03 15:36:24 +00:00
|
|
|
topics = "waku node jsonrpc debug_api"
|
2021-03-23 08:04:51 +00:00
|
|
|
|
2020-11-27 07:18:48 +00:00
|
|
|
proc installDebugApiHandlers*(node: WakuNode, rpcsrv: RpcServer) =
|
|
|
|
|
|
|
|
## Debug API version 1 definitions
|
|
|
|
|
|
|
|
rpcsrv.rpc("get_waku_v2_debug_v1_info") do() -> WakuInfo:
|
|
|
|
## Returns information about WakuNode
|
|
|
|
debug "get_waku_v2_debug_v1_info"
|
|
|
|
|
|
|
|
return node.info()
|
2022-03-30 15:17:21 +00:00
|
|
|
|
|
|
|
rpcsrv.rpc("get_waku_v2_debug_v1_version") do() -> string:
|
|
|
|
## Returns information about WakuNode
|
|
|
|
debug "get_waku_v2_debug_v1_version"
|
|
|
|
|
|
|
|
return git_version
|
|
|
|
|