package tezos-dal-node-lib

  1. Overview
  2. Docs

The worker module exposes instantiation of the Gossipsub worker functor, alongside the config used to instantiate the functor and the default values of the GS parameters.

module Config : module type of Tezos_dal_node_lib_gossipsub.Gs_interface.Worker_config with type GS.Topic.t = Tezos_dal_node_services.Types.Topic.t and type GS.Message_id.t = Tezos_dal_node_services.Types.Message_id.t and type GS.Message.t = Tezos_dal_node_services.Types.Message.t and type GS.Peer.t = Tezos_dal_node_services.Types.Peer.t and type GS.Span.t = Tezos_dal_node_services.Types.Span.t and type GS.Time.t = Tezos_dal_node_services.Types.Time.t and type 'a Monad.t = 'a Lwt.t

This module defines the default values for simple Gossip parameters and limits. These values are used or re-defined in the DAL node before instantiating the Gossipsub worker.

include Tezos_gossipsub.Gossipsub_intf.WORKER with type GS.Topic.t = Tezos_dal_node_services.Types.Topic.t and type GS.Message_id.t = Tezos_dal_node_services.Types.Message_id.t and type GS.Message.t = Tezos_dal_node_services.Types.Message.t and type GS.Peer.t = Tezos_dal_node_services.Types.Peer.t and type GS.Span.t = Tezos_dal_node_services.Types.Span.t and type GS.Time.t = Tezos_dal_node_services.Types.Time.t
type t
module GS : sig ... end
module Monad : sig ... end
module Stream : sig ... end
type message_with_header = {
  1. message : GS.Message.t;
  2. topic : GS.Topic.t;
  3. message_id : GS.Message_id.t;
}
type p2p_message =
  1. | Graft of {
    1. topic : GS.Topic.t;
    }
  2. | Prune of {
    1. topic : GS.Topic.t;
    2. px : GS.Peer.t Tezos_base.TzPervasives.Seq.t;
    3. backoff : GS.Span.t;
    }
  3. | IHave of {
    1. topic : GS.Topic.t;
    2. message_ids : GS.Message_id.t list;
    }
  4. | IWant of {
    1. message_ids : GS.Message_id.t list;
    }
  5. | Subscribe of {
    1. topic : GS.Topic.t;
    }
  6. | Unsubscribe of {
    1. topic : GS.Topic.t;
    }
  7. | Message_with_header of message_with_header
type p2p_input =
  1. | In_message of {
    1. from_peer : GS.Peer.t;
    2. p2p_message : p2p_message;
    }
  2. | New_connection of {
    1. peer : GS.Peer.t;
    2. direct : bool;
    3. trusted : bool;
    4. bootstrap : bool;
    }
  3. | Disconnection of {
    1. peer : GS.Peer.t;
    }
type app_input =
  1. | Publish_message of message_with_header
  2. | Join of GS.Topic.t
  3. | Leave of GS.Topic.t
type peer_origin =
  1. | PX of GS.Peer.t
  2. | Trusted
type p2p_output =
  1. | Out_message of {
    1. to_peer : GS.Peer.t;
    2. p2p_message : p2p_message;
    }
  2. | Disconnect of {
    1. peer : GS.Peer.t;
    }
  3. | Kick of {
    1. peer : GS.Peer.t;
    }
  4. | Connect of {
    1. peer : GS.Peer.t;
    2. origin : peer_origin;
    }
  5. | Forget of {
    1. peer : GS.Peer.t;
    2. origin : GS.Peer.t;
    }
type app_output = message_with_header
type event = private
  1. | Heartbeat
  2. | P2P_input of p2p_input
  3. | App_input of app_input
val make : ?events_logging:(event -> unit Monad.t) -> Random.State.t -> (GS.Topic.t, GS.Peer.t, GS.Message_id.t, GS.span) Tezos_gossipsub__Gossipsub_intf.limits -> (GS.Peer.t, GS.Message_id.t) Tezos_gossipsub__Gossipsub_intf.parameters -> t
val start : GS.Topic.t list -> t -> unit
val shutdown : t -> unit Monad.t
val app_input : t -> app_input -> unit
val p2p_input : t -> p2p_input -> unit
val p2p_output_stream : t -> p2p_output Stream.t
val app_output_stream : t -> app_output Stream.t
val input_events_stream : t -> event Stream.t
val is_subscribed : t -> GS.Topic.t -> bool
val pp_p2p_output : Format.formatter -> p2p_output -> unit
val pp_app_output : Format.formatter -> app_output -> unit
module Introspection : sig ... end
val stats : t -> Introspection.stats
val state : t -> GS.Introspection.view
module Logging : sig ... end
module Validate_message_hook : sig ... end

A hook to set or update messages and messages IDs validation function. Should be called once at startup and every time the DAL parameters change.

OCaml

Innovation. Community. Security.