package tezos-p2p

  1. Overview
  2. Docs
type ('msg, 'peer, 'conn) info = ('msg, 'peer, 'conn) P2p_conn.t P2p_point_state.Info.t
val info : ('msg, 'peer, 'conn) t -> Tezos_base.P2p_point.Id.t -> ('msg, 'peer, 'conn) info option
val fold_known : ('msg, 'peer, 'conn) t -> init:'a -> f: (Tezos_base.P2p_point.Id.t -> ('msg, 'peer, 'conn) P2p_conn.t P2p_point_state.Info.t -> 'a -> 'a) -> 'a
val fold_connected : ('msg, 'peer, 'conn) t -> init:'a -> f:(Tezos_base.P2p_point.Id.t -> ('msg, 'peer, 'conn) info -> 'a -> 'a) -> 'a
val add_connected : ('msg, 'peer, 'conn) t -> Tezos_base.P2p_point.Id.t -> ('msg, 'peer, 'conn) P2p_conn.t P2p_point_state.Info.t -> unit
val remove_connected : ('msg, 'peer, 'conn) t -> 'd P2p_point_state.Info.t -> unit
val ban : ('msg, 'peer, 'conn) t -> ?ban_peers:bool -> Tezos_base.P2p_point.Id.t -> unit Lwt.t

ban t point_id marks the address of this point_id as blacklisted. It disconnects and bans all connections to this address. If ban_peers is false the associated peers are disconnected but not banned. The point_id port is ignored.

val unban : ('msg, 'peer, 'conn) t -> Tezos_base.P2p_point.Id.t -> unit

unban t point_id removes this point address from the black list. and unban all associated peers. The point_id port is ignored.

val banned : ('msg, 'peer, 'conn) t -> Tezos_base.P2p_point.Id.t -> bool

banned t point_id returns true if the point addr is in the black list. This point_id's port is ignored.

val get_trusted : ('msg, 'peer, 'conn) t -> Tezos_base.P2p_point.Id.t -> bool

get_trusted t point_id returns false if this point isn't known. Otherwise it calls trusted for this peer info.

val trust : ('msg, 'peer, 'conn) t -> Tezos_base.P2p_point.Id.t -> unit

trust t point_id sets the point info for this point to trusted, and unban it. The point is registered first if not known (see register_point).

val untrust : ('msg, 'peer, 'conn) t -> Tezos_base.P2p_point.Id.t -> unit

untrust t point_id sets the point info peer info for this point to not trusted. Does nothing if point isn't known.

OCaml

Innovation. Community. Security.