Node_context.P2P
Module for P2P-related accessors.
val connect :
t ->
?timeout:Ptime.Span.t ->
Tezos_base.TzPervasives.P2p_point.Id.t ->
unit Tezos_base.TzPervasives.tzresult Lwt.t
connect t ?timeout point
initiates a connection to the point point
. The promise returned by this function is resolved once the P2P handhshake successfully completes. If the timeout
is set, an error is returned if the P2P handshake takes more than timeout
to complete.
val disconnect_point :
t ->
?wait:bool ->
Tezos_base.TzPervasives.P2p_point.Id.t ->
unit Lwt.t
disconnect_point t ?wait point
initiaties a disconnection to the point point
. The promise returned by this function is fullfiled when the socket is closed on our side. If wait
is true
, we do not close the socket before having canceled all the current messages in the write buffer. Should not matter in practice.
Due to the following issue https://gitlab.com/tezos/tezos/-/issues/5319
it may occur that a discconnection takes several minutes.
val disconnect_peer :
t ->
?wait:bool ->
Tezos_base.TzPervasives.P2p_peer.Id.t ->
unit Lwt.t
disconnect_peer t ?wait point
initiaties a disconnection to the point peer
. The promise returned by this function is fullfiled when the socket is closed on our side. If wait
is true
, we do not close the socket before having canceled all the current messages in the write buffer. Should not matter in practice.
Due to the following issue https://gitlab.com/tezos/tezos/-/issues/5319
it may occur that a discconnection takes several minutes.
val get_points :
?connected:bool ->
t ->
Tezos_base.TzPervasives.P2p_point.Id.t list Tezos_base.TzPervasives.tzresult
get_points ?connected t
returns a list of points. If connected
is true
(default), it returns only points we are currently connected. Otherwise, it returns a list of known points (points for which we were already successfully connected in the past.)
val get_points_info :
?connected:bool ->
t ->
(Tezos_base.TzPervasives.P2p_point.Id.t
* Tezos_base.TzPervasives.P2p_point.Info.t)
list
Tezos_base.TzPervasives.tzresult
get_points_info ?connected t
returns a list of info for points. If connected
is true
(default), it returns only info for points we are currently connected. Otherwise, it returns a list of infos for known points (points for which we were already successfully connected in the past.)
val get_point_info :
t ->
Tezos_base.TzPervasives.P2p_point.Id.t ->
Tezos_base.TzPervasives.P2p_point.Info.t option
Tezos_base.TzPervasives.tzresult
get_point_info t point
returns the info of the corresponding point if found.
val get_peers :
?connected:bool ->
t ->
Tezos_base.TzPervasives.P2p_peer.Id.t list Tezos_base.TzPervasives.tzresult
get_peers ?connected t
returns a list of peers. If connected
is true
(default), it returns only the peers we are connected to. Otherwise, it returns a list of known peers (peers for which we were already successfully connected in the past.)
val get_peers_info :
?connected:bool ->
t ->
(Tezos_base.TzPervasives.P2p_peer.Id.t
* Tezos_dal_node_services.Types.P2P.Peer.Info.t)
list
Tezos_base.TzPervasives.tzresult
get_peers_info ?connected t
returns a list of info for peers. If connected
is true
(default), it returns only info for peers we are currently connected. Otherwise, it returns a list of infos for known peers (peers for which we were already successfully connected in the past.)
val get_peer_info :
t ->
Tezos_base.TzPervasives.P2p_peer.Id.t ->
Tezos_dal_node_services.Types.P2P.Peer.Info.t option
Tezos_base.TzPervasives.tzresult
get_peer_info t peer
returns the info of the corresponding peer if found.
val patch_peer :
t ->
Tezos_base.TzPervasives.P2p_peer.Id.t ->
[ `Ban | `Open | `Trust ] option ->
Tezos_dal_node_services.Types.P2P.Peer.Info.t option
Tezos_base.TzPervasives.tzresult
Lwt.t
patch_peer t peer acl
patches the acl of the given peer and returns the info of the corresponding peer if found.
module Gossipsub : sig ... end