package tezos-p2p

  1. Overview
  2. Docs
type 'conn t =
  1. | Requested of {
    1. cancel : Lwt_canceler.t;
    }
    (*

    We initiated a connection.

    *)
  2. | Accepted of {
    1. current_peer_id : Tezos_base.P2p_peer.Id.t;
    2. cancel : Lwt_canceler.t;
    }
    (*

    We accepted a incoming connection.

    *)
  3. | Running of {
    1. data : 'conn;
    2. current_peer_id : Tezos_base.P2p_peer.Id.t;
    }
    (*

    Successfully authenticated connection, normal business.

    *)
  4. | Disconnected
    (*

    No connection established currently.

    *)
type 'conn state = 'conn t
val pp : Stdlib.Format.formatter -> 'conn t -> unit
module Info : sig ... end
val get : 'conn Info.t -> 'conn t
val is_disconnected : 'conn Info.t -> bool
val set_requested : timestamp:Tezos_base.Time.System.t -> 'conn Info.t -> Lwt_canceler.t -> unit
val set_accepted : timestamp:Tezos_base.Time.System.t -> 'conn Info.t -> Tezos_base.P2p_peer.Id.t -> Lwt_canceler.t -> unit
val set_running : timestamp:Tezos_base.Time.System.t -> 'conn Info.t -> Tezos_base.P2p_peer.Id.t -> 'conn -> unit
val set_private : 'conn Info.t -> bool -> unit
val set_disconnected : timestamp:Tezos_base.Time.System.t -> ?requested:bool -> Info.reconnection_config -> 'conn Info.t -> unit
val set_expected_peer_id : 'conn Info.t -> Tezos_base.P2p_peer.Id.t -> unit

set_expected_peer_id point_info peer_id associates an expected peer_id to point_info.

val get_expected_peer_id : 'conn Info.t -> Tezos_base.P2p_peer.Id.t option
OCaml

Innovation. Community. Security.