diff --git a/src/node/shell/node_rpc.ml b/src/node/shell/node_rpc.ml index 49744450d..488c250e0 100644 --- a/src/node/shell/node_rpc.ml +++ b/src/node/shell/node_rpc.ml @@ -459,6 +459,10 @@ let build_rpc_directory node = let implementation () = Node.RPC.Network.stat node |> RPC.Answer.return 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 implementation () = let stream, stopper = Node.RPC.Network.watch node in diff --git a/src/node/shell/node_rpc_services.ml b/src/node/shell/node_rpc_services.ml index 4e7c94869..cf6d7d226 100644 --- a/src/node/shell/node_rpc_services.ml +++ b/src/node/shell/node_rpc_services.ml @@ -509,6 +509,13 @@ module Network = struct ~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 = RPC.service ~description:"Global network bandwidth statistics in B/s." diff --git a/src/node/shell/node_rpc_services.mli b/src/node/shell/node_rpc_services.mli index 3c1b70c9e..b3abd91f9 100644 --- a/src/node/shell/node_rpc_services.mli +++ b/src/node/shell/node_rpc_services.mli @@ -124,6 +124,9 @@ module Network : sig val stat : (unit, unit, unit, P2p.Stat.t) RPC.service + val versions : + (unit, unit, unit, P2p.Version.t list) RPC.service + val events : (unit, unit, unit, P2p.RPC.Event.t) RPC.service