package octez-shell-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=aa2f5bc99cc4ca2217c52a1af2a2cdfd3b383208cb859ca2e79ca0903396ca1d
sha512=d68bb3eb615e3dcccc845fddfc9901c95b3c6dc8e105e39522ce97637b1308a7fa7aa1d271351d5933febd7476b2819e1694f31198f1f0919681f1f9cc97cb3a
doc/octez-shell-libs.p2p/Tezos_p2p/P2p_pool/Peers/index.html
Module P2p_pool.Peers
Source
type ('msg, 'peer, 'conn) info =
(('msg, 'peer, 'conn) P2p_conn.t, 'peer, 'conn) P2p_peer_state.Info.t
val info :
('msg, 'peer, 'conn) t ->
Tezos_base.TzPervasives.P2p_peer.Id.t ->
('msg, 'peer, 'conn) info option
val get_peer_metadata :
('msg, 'peer, 'conn) t ->
Tezos_base.TzPervasives.P2p_peer.Id.t ->
'peer
val set_peer_metadata :
('msg, 'peer, 'conn) t ->
Tezos_base.TzPervasives.P2p_peer.Id.t ->
'peer ->
unit
val fold_known :
('msg, 'peer, 'conn) t ->
init:'a ->
f:
(Tezos_base.TzPervasives.P2p_peer.Id.t ->
('msg, 'peer, 'conn) info ->
'a ->
'a) ->
'a
fold_known pool ~init ~f
computes (f iN pN ... (f i1 p1 init)...)
where id1 ... idN
are the ids of every known peers and p1 ... pN
the associated peers info.
val iter_known :
(Tezos_base.TzPervasives.P2p_peer.Id.t -> ('msg, 'peer, 'conn) info -> unit) ->
('msg, 'peer, 'conn) t ->
unit
iter_known f pool
applies f
to all known peers of pool
.
val fold_connected :
('msg, 'peer, 'conn) t ->
init:'a ->
f:
(Tezos_base.TzPervasives.P2p_peer.Id.t ->
('msg, 'peer, 'conn) info ->
'a ->
'a) ->
'a
fold_connected pool ~init ~f
computes (f iN pN ... (f i1 p1 init)...)
where id1 ... idN
are the ids of every connected peers and p1 ... pN
the associated peers info.
val add_connected :
('msg, 'peer, 'conn) t ->
Tezos_base.TzPervasives.P2p_peer.Id.t ->
(('msg, 'peer, 'conn) P2p_conn.t, 'peer, 'conn) P2p_peer_state.Info.t ->
unit
val remove_connected :
('msg, 'peer, 'conn) t ->
Tezos_base.TzPervasives.P2p_peer.Id.t ->
unit
ban t peer_id
blacklists this peer_id and terminates connection (if any).
unban t peer_id
removes this peer_id from the black list.
banned t peer_id
returns true
if the peer is in the black list.
get_trusted t peer_id
returns false
if this peer isn't known. Otherwise it calls trusted
for this peer info.
trust t peer_id
sets the peer info for this peer to trusted, and unban
it. The peer is registered first if not known (see register_peer
).
untrust t peer_id
set the peer info for this peer to not trusted. Does nothing if this peer isn't known.
val get_greylisted_list :
('msg, 'peer, 'conn) t ->
Tezos_base.TzPervasives.P2p_peer.Id.t list
get_greylisted_list t
returns the list of all the greylisted peers