Commit e9eac31e authored by Seb Mondet's avatar Seb Mondet

Add `/monitor/commit_hash` RPC

parent b4e6018d
......@@ -147,4 +147,8 @@ let build_rpc_directory validator mainchain_validator =
RPC_answer.return_stream { next ; shutdown }
end ;
gen_register0 Monitor_services.S.commit_hash begin fun () () ->
RPC_answer.return Tezos_base.Current_git_info.commit_hash
end ;
!dir
......@@ -100,6 +100,13 @@ module S = struct
~output: Protocol_hash.encoding
RPC_path.(path / "protocols")
let commit_hash =
RPC_service.get_service
~description:"Get information on the build of the node."
~query: RPC_query.empty
~output: string
RPC_path.(path / "commit_hash")
end
open RPC_context
......@@ -122,3 +129,6 @@ let heads ctxt ?(next_protocols = []) chain =
let protocols ctxt =
make_streamed_call S.protocols ctxt () () ()
let commit_hash ctxt =
make_call S.commit_hash ctxt () () ()
......@@ -45,6 +45,8 @@ val protocols:
#streamed ->
(Protocol_hash.t Lwt_stream.t * stopper) tzresult Lwt.t
val commit_hash: #simple -> string tzresult Lwt.t
module S : sig
val bootstrapped:
......@@ -70,5 +72,7 @@ module S : sig
unit, unit, unit,
Protocol_hash.t) RPC_service.t
val commit_hash:
([ `GET ], unit, unit, unit, unit, string) RPC_service.t
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment