diff --git a/Makefile b/Makefile index 669a0a36d..393ec506c 100644 --- a/Makefile +++ b/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 diff --git a/waku/v2/node/jsonrpc/debug_api.nim b/waku/v2/node/jsonrpc/debug_api.nim index 0b3810d4c..a3ae5a110 100644 --- a/waku/v2/node/jsonrpc/debug_api.nim +++ b/waku/v2/node/jsonrpc/debug_api.nim @@ -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 +