Module Mavryk_base_unix.P2p_resolve

type Mavryk_base.TzPervasives.error +=
  1. | Failed_to_parse_address of string * string
val resolve_addr_with_peer_id : default_addr:string -> default_port:int -> ?passive:bool -> string -> (Mavryk_base.TzPervasives.P2p_point.Id.t * Mavryk_base.TzPervasives.P2p_peer.Id.t option) list Mavryk_base.TzPervasives.tzresult Lwt.t

resolve_addr_with_peer_id ~default_addr ~default_port ?passive addr parses addr to return the corresponding points.

The format of addr can be either an IP address (v4 or v6) or a domain name. If a domain name is provided, a DNS lookup is made (see Unix.getaddrinfo).

Moreover, a peer id can be provided by postfixing the addr with #<peer_id>. The peer id should be provided using the b58 format.

An event is emitted if the DNS lookup returned 0 points.

The error Failed_to_parse_address is returned if the parsing failed.

val resolve_addr : default_addr:string -> default_port:int -> ?passive:bool -> string -> Mavryk_base.TzPervasives.P2p_point.Id.t list Mavryk_base.TzPervasives.tzresult Lwt.t

resolve_addr is the same as resolve_addr_with_peer_id but no peer id is expected.

A warning event is emitted if a peer_id was provided.