package tezos-base

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type addr_port_id = {
  1. addr : string;
    (*

    String representation of an address. This address can be an IPv4 or IPv6 or a domain.

    *)
  2. port : int option;
    (*

    If specified, a port number in 0-65535.

    *)
  3. peer_id : P2p_peer_id.t option;
    (*

    If specified, a peer_id. This field is given by the user to ensure the identity of the node behind the address.

    *)
}
val compare : t -> t -> int
val equal : t -> t -> bool
val pp : Stdlib.Format.formatter -> t -> unit
val pp_opt : Stdlib.Format.formatter -> t option -> unit
val pp_list : Stdlib.Format.formatter -> t list -> unit
val of_string_exn : ?default_port:int -> string -> t
val of_string : ?default_port:int -> string -> (t, string) Stdlib.result
val to_string : t -> string
val encoding : t Data_encoding.t
val is_local : t -> bool
val is_global : t -> bool
val rpc_arg : t Tezos_rpc.RPC_arg.t
type parsing_error =
  1. | Port_not_in_range of int
  2. | Bad_id_format of string
  3. | Bad_format
val string_of_parsing_error : parsing_error -> string
val parse_addr_port_id : string -> (addr_port_id, parsing_error) Stdlib.result

parse_addr_port_id addr_port_id splits the addr_port_id into an addr, a port and an id (as a b58 hash). Both port and id are optional. This function checks that the port is between 0-65535. The character ':' separates the addr and the port while the character '#' separates the addr or the port from the id. The function assumes that addr can be either an Ipv6 address, an Ipv4 address or a domain. The address is formatted so that it can be given to Lwt.getaddrinfo. This means that square brackets around ipv6 addresses are removed.

val addr_port_id_to_string : addr_port_id -> string
val pp_addr_port_id : Stdlib.Format.formatter -> addr_port_id -> unit
val hash : t -> int
OCaml

Innovation. Community. Security.