mirror of https://github.com/waku-org/nwaku.git
feat(jsonrpc): add call returning git version (#919)
This commit is contained in:
parent
ec0a46b65b
commit
2f13aff663
4
Makefile
4
Makefile
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue