package octez-libs

  1. Overview
  2. Docs
A package that contains multiple base libraries used by the Octez suite

Install

Dune Dependency

Authors

Maintainers

Sources

octez-19.0.tar.gz
sha256=c6df840ebbf115e454db949028c595bec558a59a66cade73b52a6d099d6fa4d4
sha512=d8aee903b9fe130d73176bc8ec38b78c9ff65317da3cb4f3415f09af0c625b4384e7498201fdb61aa39086a7d5d409d0ab3423f9bc3ab989a680cf444a79bc13

doc/octez-libs.base/Tezos_base/P2p_params/index.html

Module Tezos_base.P2p_paramsSource

Types of the abstract data types (ADT) which parameterize the P2p layer.

Many types used in the P2p layer are parameterized by three type parameters:

  • 'msg: type of messages exchanged between peers
  • 'peer_meta: type of the metadata associated with peers (score, etc.)
  • 'conn_meta: type of the metadata associated with connections

These types are kept abstract from the P2p layer. It can only operate on them via a set of functions packed in a "configuration" record passed by the upper layer (see also P2p and P2p.create).

This module defines the type of these configuration records.

Sourcetype 'peer_meta peer_meta_config = {
  1. peer_meta_encoding : 'peer_meta Data_encoding.t;
  2. peer_meta_initial : unit -> 'peer_meta;
    (*

    Constructor

    *)
  3. score : 'peer_meta -> float;
    (*

    Score of a peer, used for ordering

    *)
}

Metadata for a peer

Sourcetype 'conn_meta conn_meta_config = {
  1. conn_meta_encoding : 'conn_meta Data_encoding.t;
  2. conn_meta_value : unit -> 'conn_meta;
    (*

    Constructor

    *)
  3. private_node : 'conn_meta -> bool;
    (*

    Returns true if peer at the other end of the connection is in private mode

    *)
}

Metadata for a connection.

Sourcetype 'msg app_message_encoding =
  1. | Encoding : {
    1. tag : int;
    2. title : string;
    3. encoding : 'a Data_encoding.t;
    4. wrap : 'a -> 'msg;
    5. unwrap : 'msg -> 'a option;
    6. max_length : int option;
    } -> 'msg app_message_encoding
Sourcetype 'msg message_config = {
  1. encoding : 'msg app_message_encoding list;
    (*

    Encoding of the messages.

    *)
  2. chain_name : Distributed_db_version.Name.t;
    (*

    Identifier for this P2p protocol when establishing session.

    *)
  3. distributed_db_versions : Distributed_db_version.t list;
    (*

    List of versions supported by this P2p protocol.

    *)
}

Application-level messages encoding, and version parameters

OCaml

Innovation. Community. Security.