Skip to main content

Module peer_address

Module peer_address 

Source
Expand description

Address shapes the overlay accepts. A direct address is <host>/tcp/<port> or <host>/udp/<port>/quic-v1 (host an IP literal or DNS name), or /dnsaddr/<name>. A circuit address reaches its peer through a relay: /ip4/<public relay IP>/<transport>/p2p/<relay>/p2p-circuit. Either may end in /p2p/<peer>. Shape checks never resolve, dial or trust anything.

Structs§

PeerAddress
A syntactically validated sync source: a direct IP-literal address with a terminal /p2p naming the peer. Never a circuit: data stays off relays. Validation establishes neither reachability nor trust in the named peer.
Shape
A dialable address split into its bare form (no terminal /p2p), the identity it names and its kind.

Enums§

AddressKind
Dialed
What a dial reached. A relayed-only peer is not reached yet: records/5 (and with it the chain probe) never runs over a circuit, so the peer counts once DCUtR has given it a direct connection and the probe passed.

Functions§

is_circuit
Whether the address goes through a relay; shape is not checked.
is_quic
Whether the address dials over QUIC; shape is not checked.
parse
Validate one address. IPs must be usable destinations; a circuit’s relay hop is a public IPv4 literal and its relay is never the peer it names.
relay
The relay of a valid circuit address.