2018-06-29 16:08:08 +04:00
|
|
|
(*****************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* Open Source License *)
|
|
|
|
(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* Permission is hereby granted, free of charge, to any person obtaining a *)
|
|
|
|
(* copy of this software and associated documentation files (the "Software"),*)
|
|
|
|
(* to deal in the Software without restriction, including without limitation *)
|
|
|
|
(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)
|
|
|
|
(* and/or sell copies of the Software, and to permit persons to whom the *)
|
|
|
|
(* Software is furnished to do so, subject to the following conditions: *)
|
|
|
|
(* *)
|
|
|
|
(* The above copyright notice and this permission notice shall be included *)
|
|
|
|
(* in all copies or substantial portions of the Software. *)
|
|
|
|
(* *)
|
|
|
|
(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)
|
|
|
|
(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)
|
|
|
|
(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)
|
|
|
|
(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)
|
|
|
|
(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)
|
|
|
|
(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)
|
|
|
|
(* DEALINGS IN THE SOFTWARE. *)
|
|
|
|
(* *)
|
|
|
|
(*****************************************************************************)
|
2018-01-22 21:58:43 +04:00
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
open RPC_context
|
2018-01-22 21:58:43 +04:00
|
|
|
|
2018-08-08 16:10:47 +04:00
|
|
|
val self: #simple -> P2p_peer.Id.t tzresult Lwt.t
|
2018-06-13 18:03:19 +04:00
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
val stat: #simple -> P2p_stat.t tzresult Lwt.t
|
2018-01-22 21:58:43 +04:00
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
val versions: #simple -> P2p_version.t list tzresult Lwt.t
|
2018-01-22 21:58:43 +04:00
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
val events: #streamed ->
|
|
|
|
(P2p_connection.Pool_event.t Lwt_stream.t * stopper) tzresult Lwt.t
|
2018-01-22 21:58:43 +04:00
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
val connect: #simple -> timeout:float -> P2p_point.Id.t -> unit tzresult Lwt.t
|
2018-01-22 21:58:43 +04:00
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
module S : sig
|
|
|
|
|
2018-08-08 16:10:47 +04:00
|
|
|
val self :
|
2018-06-13 18:03:19 +04:00
|
|
|
([ `GET ], unit,
|
|
|
|
unit, unit, unit,
|
|
|
|
P2p_peer.Id.t) RPC_service.t
|
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
val stat :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-02-08 13:51:02 +04:00
|
|
|
unit, unit, unit,
|
|
|
|
P2p_stat.t) RPC_service.t
|
|
|
|
|
|
|
|
val versions :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-01-22 21:58:43 +04:00
|
|
|
unit, unit, unit,
|
2018-02-08 13:51:02 +04:00
|
|
|
P2p_version.t list) RPC_service.t
|
2018-01-22 21:58:43 +04:00
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
val events :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-02-08 13:51:02 +04:00
|
|
|
unit, unit, unit,
|
|
|
|
P2p_connection.Pool_event.t) RPC_service.t
|
2018-01-22 21:58:43 +04:00
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
val connect :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `PUT ], unit,
|
|
|
|
unit * P2p_point.Id.t, < timeout: float >, unit,
|
2018-02-11 22:17:39 +04:00
|
|
|
unit) RPC_service.t
|
2018-01-22 21:58:43 +04:00
|
|
|
|
|
|
|
end
|
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
module Connections : sig
|
|
|
|
|
|
|
|
open RPC_context
|
|
|
|
|
2018-06-05 03:45:43 +04:00
|
|
|
type connection_info = Connection_metadata.t P2p_connection.Info.t
|
2018-02-08 13:51:02 +04:00
|
|
|
|
2018-06-05 03:45:43 +04:00
|
|
|
val list: #simple -> connection_info list tzresult Lwt.t
|
|
|
|
|
|
|
|
val info: #simple -> P2p_peer.Id.t -> connection_info tzresult Lwt.t
|
2018-02-08 13:51:02 +04:00
|
|
|
|
|
|
|
val kick: #simple -> ?wait:bool -> P2p_peer.Id.t -> unit tzresult Lwt.t
|
|
|
|
|
|
|
|
module S : sig
|
|
|
|
|
|
|
|
val list :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-02-08 13:51:02 +04:00
|
|
|
unit, unit, unit,
|
2018-06-05 03:45:43 +04:00
|
|
|
connection_info list) RPC_service.t
|
2018-02-08 13:51:02 +04:00
|
|
|
|
|
|
|
val info :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-02-08 13:51:02 +04:00
|
|
|
unit * P2p_peer.Id.t, unit, unit,
|
2018-06-05 03:45:43 +04:00
|
|
|
connection_info) RPC_service.t
|
2018-02-08 13:51:02 +04:00
|
|
|
|
|
|
|
val kick :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `DELETE ], unit,
|
|
|
|
unit * P2p_peer.Id.t, < wait: bool >, unit,
|
2018-02-08 13:51:02 +04:00
|
|
|
unit) RPC_service.t
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2018-01-22 21:58:43 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
module Points : sig
|
2018-01-22 21:58:43 +04:00
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
val list:
|
2018-04-21 14:46:33 +04:00
|
|
|
?filter:(P2p_point.Filter.t list) ->
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple -> (P2p_point.Id.t * P2p_point.Info.t) list tzresult Lwt.t
|
2018-01-22 21:58:43 +04:00
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
val info: #simple -> P2p_point.Id.t -> P2p_point.Info.t tzresult Lwt.t
|
|
|
|
|
|
|
|
val events:
|
|
|
|
#streamed ->
|
|
|
|
P2p_point.Id.t ->
|
|
|
|
(P2p_point.Pool_event.t list Lwt_stream.t * stopper) tzresult Lwt.t
|
|
|
|
|
2018-02-22 18:35:50 +04:00
|
|
|
val ban: #simple -> P2p_point.Id.t -> unit tzresult Lwt.t
|
|
|
|
|
2018-10-10 16:21:27 +04:00
|
|
|
val unban: #simple -> P2p_point.Id.t -> unit tzresult Lwt.t
|
|
|
|
|
2018-02-22 18:35:50 +04:00
|
|
|
val trust: #simple -> P2p_point.Id.t -> unit tzresult Lwt.t
|
|
|
|
|
2018-10-10 16:21:27 +04:00
|
|
|
val untrust: #simple -> P2p_point.Id.t -> unit tzresult Lwt.t
|
|
|
|
|
2018-03-11 18:02:59 +04:00
|
|
|
val banned: #simple -> P2p_point.Id.t -> bool tzresult Lwt.t
|
2018-02-22 18:35:50 +04:00
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
module S : sig
|
|
|
|
|
|
|
|
val list :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
|
|
|
unit, < filters: P2p_point.Filter.t list >, unit,
|
2018-02-08 13:51:02 +04:00
|
|
|
(P2p_point.Id.t * P2p_point.Info.t) list) RPC_service.t
|
|
|
|
|
|
|
|
val info :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-02-08 13:51:02 +04:00
|
|
|
unit * P2p_point.Id.t, unit, unit,
|
|
|
|
P2p_point.Info.t) RPC_service.t
|
|
|
|
|
|
|
|
val events :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-06-13 18:03:19 +04:00
|
|
|
unit * P2p_point.Id.t, < monitor: bool>, unit,
|
2018-02-08 13:51:02 +04:00
|
|
|
P2p_point.Pool_event.t list) RPC_service.t
|
|
|
|
|
2018-10-10 16:21:27 +04:00
|
|
|
val ban :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-02-22 18:35:50 +04:00
|
|
|
unit * P2p_point.Id.t, unit, unit,
|
|
|
|
unit) RPC_service.t
|
|
|
|
|
2018-10-10 16:21:27 +04:00
|
|
|
val unban :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-02-22 18:35:50 +04:00
|
|
|
unit * P2p_point.Id.t, unit, unit,
|
|
|
|
unit) RPC_service.t
|
|
|
|
|
|
|
|
val trust :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-02-22 18:35:50 +04:00
|
|
|
unit * P2p_point.Id.t, unit, unit,
|
|
|
|
unit) RPC_service.t
|
|
|
|
|
2018-10-10 16:21:27 +04:00
|
|
|
val untrust :
|
|
|
|
([ `GET ], unit,
|
|
|
|
unit * P2p_point.Id.t, unit, unit,
|
|
|
|
unit) RPC_service.t
|
|
|
|
|
2018-03-11 18:02:59 +04:00
|
|
|
val banned :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-02-22 18:35:50 +04:00
|
|
|
unit * P2p_point.Id.t, unit, unit,
|
|
|
|
bool) RPC_service.t
|
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
module Peers : sig
|
|
|
|
|
|
|
|
val list:
|
2018-04-21 14:46:33 +04:00
|
|
|
?filter:(P2p_peer.Filter.t list) ->
|
2018-02-08 13:51:02 +04:00
|
|
|
#simple ->
|
2018-07-25 20:00:22 +04:00
|
|
|
(P2p_peer.Id.t * (Peer_metadata.t, Connection_metadata.t) P2p_peer.Info.t) list tzresult Lwt.t
|
2018-02-08 13:51:02 +04:00
|
|
|
|
2018-05-22 21:00:20 +04:00
|
|
|
val info:
|
|
|
|
#simple -> P2p_peer.Id.t ->
|
2018-07-25 20:00:22 +04:00
|
|
|
(Peer_metadata.t, Connection_metadata.t) P2p_peer.Info.t tzresult Lwt.t
|
2018-02-08 13:51:02 +04:00
|
|
|
|
|
|
|
val events:
|
|
|
|
#streamed -> P2p_peer.Id.t ->
|
|
|
|
(P2p_peer.Pool_event.t list Lwt_stream.t * stopper) tzresult Lwt.t
|
|
|
|
|
2018-02-22 18:35:50 +04:00
|
|
|
val ban: #simple -> P2p_peer.Id.t -> unit tzresult Lwt.t
|
|
|
|
|
2018-10-10 16:21:27 +04:00
|
|
|
val unban: #simple -> P2p_peer.Id.t -> unit tzresult Lwt.t
|
|
|
|
|
2018-02-22 18:35:50 +04:00
|
|
|
val trust: #simple -> P2p_peer.Id.t -> unit tzresult Lwt.t
|
|
|
|
|
2018-10-10 16:21:27 +04:00
|
|
|
val untrust: #simple -> P2p_peer.Id.t -> unit tzresult Lwt.t
|
|
|
|
|
2018-03-11 18:02:59 +04:00
|
|
|
val banned: #simple -> P2p_peer.Id.t -> bool tzresult Lwt.t
|
2018-02-22 18:35:50 +04:00
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
module S : sig
|
|
|
|
|
|
|
|
val list :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
|
|
|
unit, < filters: P2p_peer.Filter.t list >, unit,
|
2018-07-25 20:00:22 +04:00
|
|
|
(P2p_peer.Id.t * (Peer_metadata.t, Connection_metadata.t) P2p_peer.Info.t) list) RPC_service.t
|
2018-02-08 13:51:02 +04:00
|
|
|
|
|
|
|
val info :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-02-08 13:51:02 +04:00
|
|
|
unit * P2p_peer.Id.t, unit, unit,
|
2018-07-25 20:00:22 +04:00
|
|
|
(Peer_metadata.t, Connection_metadata.t) P2p_peer.Info.t) RPC_service.t
|
2018-02-08 13:51:02 +04:00
|
|
|
|
|
|
|
val events :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
|
|
|
unit * P2p_peer.Id.t, < monitor: bool>, unit,
|
2018-02-08 13:51:02 +04:00
|
|
|
P2p_peer.Pool_event.t list) RPC_service.t
|
|
|
|
|
2018-10-10 16:21:27 +04:00
|
|
|
val ban :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-02-22 18:35:50 +04:00
|
|
|
unit * P2p_peer.Id.t, unit, unit,
|
|
|
|
unit) RPC_service.t
|
|
|
|
|
2018-10-10 16:21:27 +04:00
|
|
|
val unban :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-02-22 18:35:50 +04:00
|
|
|
unit * P2p_peer.Id.t, unit, unit,
|
|
|
|
unit) RPC_service.t
|
|
|
|
|
|
|
|
val trust :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-02-22 18:35:50 +04:00
|
|
|
unit * P2p_peer.Id.t, unit, unit,
|
|
|
|
unit) RPC_service.t
|
|
|
|
|
2018-10-10 16:21:27 +04:00
|
|
|
val untrust :
|
|
|
|
([ `GET ], unit,
|
|
|
|
unit * P2p_peer.Id.t, unit, unit,
|
|
|
|
unit) RPC_service.t
|
|
|
|
|
2018-03-11 18:02:59 +04:00
|
|
|
val banned :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-02-22 18:35:50 +04:00
|
|
|
unit * P2p_peer.Id.t, unit, unit,
|
|
|
|
bool) RPC_service.t
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2018-03-11 18:02:59 +04:00
|
|
|
module ACL : sig
|
2018-02-22 18:35:50 +04:00
|
|
|
|
|
|
|
val clear: #simple -> unit -> unit tzresult Lwt.t
|
|
|
|
|
|
|
|
module S : sig
|
|
|
|
|
|
|
|
val clear :
|
2018-04-21 14:46:33 +04:00
|
|
|
([ `GET ], unit,
|
2018-02-22 18:35:50 +04:00
|
|
|
unit, unit, unit,
|
|
|
|
unit) RPC_service.t
|
|
|
|
|
2018-02-08 13:51:02 +04:00
|
|
|
end
|
2018-01-22 21:58:43 +04:00
|
|
|
|
|
|
|
end
|