Shell: preliminary work for ack_cfg exchange

This commit is contained in:
michael 2018-06-01 17:10:54 +02:00 committed by Pierre Chambart
parent 1f6302bf36
commit a8e607a5a9
3 changed files with 25 additions and 5 deletions

View File

@ -72,8 +72,8 @@ let peer_metadata_cfg : _ P2p.peer_meta_config = {
}
let connection_metadata_cfg : _ P2p.conn_meta_config = {
conn_meta_encoding = Peer_metadata.encoding ;
conn_meta_value = fun _ -> () ;
conn_meta_encoding = Connection_metadata.encoding ;
conn_meta_value = fun _ -> { disable_mempool = false ; private_node = false} ;
}
let init_p2p p2p_params =

View File

@ -7,5 +7,20 @@
(* *)
(**************************************************************************)
type t = unit
let encoding = Data_encoding.empty
type t = {
disable_mempool : bool ;
private_node : bool ;
}
let encoding =
let open Data_encoding in
(conv
(fun { disable_mempool ; private_node } ->
disable_mempool , private_node)
(fun (disable_mempool , private_node) ->
{ disable_mempool ; private_node }))
(obj2
(req "disable_mempool" bool)
(req "private_node" bool))
let pp _ppf _ = ()

View File

@ -9,5 +9,10 @@
(** All the metadata associated to a running connection. *)
type t = unit (* TODO *)
type t = {
disable_mempool : bool ;
private_node : bool ;
}
val encoding: t Data_encoding.t
val pp: Format.formatter -> t -> unit