2022-03-23 13:20:07 +00:00
|
|
|
{.push raises: [Defect].}
|
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,
|
|
|
|
../wakunode2
|
|
|
|
|
2021-03-23 08:04:51 +00:00
|
|
|
logScope:
|
|
|
|
topics = "debug api"
|
|
|
|
|
2022-03-30 15:17:21 +00:00
|
|
|
const
|
|
|
|
git_version {.strdefine.} = "n/a"
|
|
|
|
|
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
|
|
|
|
|