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,
|
2023-02-10 09:43:16 +00:00
|
|
|
json_rpc/rpcserver
|
|
|
|
import
|
|
|
|
../../../../waku/v2/node/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
|
|
|
|
2023-02-10 09:43:16 +00:00
|
|
|
proc installDebugApiHandlers*(node: WakuNode, server: RpcServer) =
|
2020-11-27 07:18:48 +00:00
|
|
|
|
|
|
|
## Debug API version 1 definitions
|
|
|
|
|
2023-02-10 09:43:16 +00:00
|
|
|
server.rpc("get_waku_v2_debug_v1_info") do () -> WakuInfo:
|
2020-11-27 07:18:48 +00:00
|
|
|
## Returns information about WakuNode
|
|
|
|
debug "get_waku_v2_debug_v1_info"
|
|
|
|
|
|
|
|
return node.info()
|
2022-03-30 15:17:21 +00:00
|
|
|
|
2023-02-10 09:43:16 +00:00
|
|
|
server.rpc("get_waku_v2_debug_v1_version") do () -> string:
|
2022-03-30 15:17:21 +00:00
|
|
|
## Returns information about WakuNode
|
|
|
|
debug "get_waku_v2_debug_v1_version"
|
|
|
|
|
|
|
|
return git_version
|
|
|
|
|