diff --git a/src/lib_shell/node.ml b/src/lib_shell/node.ml index 34c0328e5..8379ffeae 100644 --- a/src/lib_shell/node.ml +++ b/src/lib_shell/node.ml @@ -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 = diff --git a/src/lib_shell_services/connection_metadata.ml b/src/lib_shell_services/connection_metadata.ml index 1bd9c324d..20aa0dc01 100644 --- a/src/lib_shell_services/connection_metadata.ml +++ b/src/lib_shell_services/connection_metadata.ml @@ -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 _ = () diff --git a/src/lib_shell_services/connection_metadata.mli b/src/lib_shell_services/connection_metadata.mli index 4a1dd6f08..30f4e40cc 100644 --- a/src/lib_shell_services/connection_metadata.mli +++ b/src/lib_shell_services/connection_metadata.mli @@ -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