feat(jsonrpc): add call returning git version (#919)

This commit is contained in:
Daniel Kaiser 2022-03-30 17:17:21 +02:00 committed by GitHub
parent ec0a46b65b
commit 2f13aff663
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -99,6 +99,10 @@ endif
# use a separate waku discv5 network with `protocol-id="d5waku"`
NIM_PARAMS := $(NIM_PARAMS) -d:discv5_protocol_id:d5waku
# git version for JSON RPC call
GIT_VERSION := "$(shell git describe --abbrev=6 --always --tags)"
NIM_PARAMS := $(NIM_PARAMS) -d:git_version:\"$(GIT_VERSION)\"
deps: | deps-common nat-libs waku.nims rlnlib
ifneq ($(USE_LIBBACKTRACE), 0)
deps: | libbacktrace

View File

@ -8,6 +8,9 @@ import
logScope:
topics = "debug api"
const
git_version {.strdefine.} = "n/a"
proc installDebugApiHandlers*(node: WakuNode, rpcsrv: RpcServer) =
## Debug API version 1 definitions
@ -17,3 +20,10 @@ proc installDebugApiHandlers*(node: WakuNode, rpcsrv: RpcServer) =
debug "get_waku_v2_debug_v1_info"
return node.info()
rpcsrv.rpc("get_waku_v2_debug_v1_version") do() -> string:
## Returns information about WakuNode
debug "get_waku_v2_debug_v1_version"
return git_version