Adds a mapping between one or more IP addresses and a domain name - when
getAddresses
is invoked, where the IP addresses are present in a
multiaddr, an additional multiaddr will be added with ip4
and ip6
tuples replaced with dns4
and `dns6 ones respectively.
The domain name to map.
The associated IP addresses.
Add peer observed addresses. These will then appear in the output of getObservedAddrs but not getAddresses() until their dialability has been confirmed via a call to confirmObservedAddr.
The observed address to add.
Add a publicly routable address/port/protocol tuple that this node is reachable on. Where this node listens on a link-local (e.g. LAN) address with the same protocol for any transport, an additional listen address will be added with the IP and port replaced with this IP and port.
It's possible to add a IPv6 address here and have it added to the address list, this is for the case when a router has an external IPv6 address with port forwarding configured, but it does IPv6 -> IPv4 NAT.
The internal IP address.
The internal port number.
The external IP address.
Optional
externalPort: numberThe external port number (optional).
Optional
protocol: "tcp" | "udp"The transport protocol (tcp
or udp
).
Signal that we have confidence an observed multiaddr is publicly dialable - this will make it appear in the output of getAddresses()
The observed address.
Optional
options: ConfirmAddressOptionsAdditional options for confirmation.
Return all known addresses with metadata
An array of NodeAddress
objects.
Signal that we do not have confidence an observed multiaddr is publicly dialable - this will remove it from the output of getObservedAddrs()
The observed address to remove.
Remove a publicly routable address that this node is no longer reachable on
The internal IP address.
The internal port number.
The external IP address.
Optional
externalPort: numberThe external port number (optional).
Optional
protocol: "tcp" | "udp"The transport protocol (tcp
or udp
).
The
AddressManager
provides an interface for managing peer addresses in libp2p. It supports handling multiple types of addresses, verifying their validity, and storing mappings between internal and external addresses.