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