package tezos-p2p

  1. Overview
  2. Docs
val fold : ('msg, 'peer, 'conn) t -> init:'a -> f:(Tezos_base.P2p_peer.Id.t -> ('msg, 'peer, 'conn) P2p_conn.t -> 'a -> 'a) -> 'a
val list : ('msg, 'peer, 'conn) t -> (Tezos_base.P2p_peer.Id.t * ('msg, 'peer, 'conn) P2p_conn.t) list
val find_by_point : ('msg, 'peer, 'conn) t -> Tezos_base.P2p_point.Id.t -> ('msg, 'peer, 'conn) P2p_conn.t option
val find_by_peer_id : ('msg, 'peer, 'conn) t -> Tezos_base.P2p_peer.Id.t -> ('msg, 'peer, 'conn) P2p_conn.t option
val random_addr : ?different_than:('msg, 'peer, 'conn) P2p_conn.t -> no_private:bool -> ('msg, 'peer, 'conn) t -> (Tezos_base.P2p_point.Id.t * Tezos_base.P2p_peer.Id.t) option

random_addr ?conn no_private t returns a random (point_id, peer_id) from the pool of connections. It ignores:

  • connections to private peers if no_private is set to true
  • connection conn
  • connections to peers who didn't provide a listening port at session-establishment
val propose_swap_request : ('msg, 'peer, 'conn) t -> (Tezos_base.P2p_point.Id.t * Tezos_base.P2p_peer.Id.t * ('msg, 'peer, 'conn) P2p_conn.t) option

propose_swap_request t returns a triple (point_id, peer_id, conn) where conn is a random connection to a non-private peer, and (point_id, peer_id) is a random, different, connected peer_id at point_id.

OCaml

Innovation. Community. Security.