Shell: add RPC to list network protocol versions.

This commit is contained in:
Benjamin Canou 2017-03-13 18:08:45 +01:00
parent 16bae53015
commit b5f0021016
3 changed files with 14 additions and 0 deletions

View File

@ -459,6 +459,10 @@ let build_rpc_directory node =
let implementation () = let implementation () =
Node.RPC.Network.stat node |> RPC.Answer.return in Node.RPC.Network.stat node |> RPC.Answer.return in
RPC.register0 dir Services.Network.stat implementation in RPC.register0 dir Services.Network.stat implementation in
let dir =
let implementation () =
RPC.Answer.return Distributed_db.Raw.supported_versions in
RPC.register0 dir Services.Network.versions implementation in
let dir = let dir =
let implementation () = let implementation () =
let stream, stopper = Node.RPC.Network.watch node in let stream, stopper = Node.RPC.Network.watch node in

View File

@ -509,6 +509,13 @@ module Network = struct
~construct:Point.to_string ~construct:Point.to_string
() ()
let versions =
RPC.service
~description:"Supported network layer versions."
~input: empty
~output: (list P2p.Version.encoding)
RPC.Path.(root / "network" / "versions")
let stat = let stat =
RPC.service RPC.service
~description:"Global network bandwidth statistics in B/s." ~description:"Global network bandwidth statistics in B/s."

View File

@ -124,6 +124,9 @@ module Network : sig
val stat : val stat :
(unit, unit, unit, P2p.Stat.t) RPC.service (unit, unit, unit, P2p.Stat.t) RPC.service
val versions :
(unit, unit, unit, P2p.Version.t list) RPC.service
val events : val events :
(unit, unit, unit, P2p.RPC.Event.t) RPC.service (unit, unit, unit, P2p.RPC.Event.t) RPC.service