package identify

Import Path
	github.com/libp2p/go-libp2p/p2p/protocol/identify (on go.dev)

Dependency Relation
	imports 31 packages, and imported by 5 packages


Package-Level Type Names (total 5)
/* sort by: | */
( IDService) Close() error IdentifyConn synchronously triggers an identify request on the connection and waits for it to complete. If the connection is being identified by another caller, this call will wait. If the connection has already been identified, it will return immediately. IdentifyWait triggers an identify (if the connection has not already been identified) and returns a channel that is closed when the identify protocol completes. ObservedAddrsFor returns the addresses peers have reported we've dialed from, for a specific local address. OwnObservedAddrs returns the addresses peers have reported we've dialed from ( IDService) Start() IDService : github.com/prometheus/common/expfmt.Closer IDService : io.Closer func github.com/libp2p/go-libp2p/p2p/host/basic.(*BasicHost).IDService() IDService func github.com/libp2p/go-libp2p/p2p/protocol/holepunch.NewService(h host.Host, ids IDService, listenAddrs func() []ma.Multiaddr, opts ...holepunch.Option) (*holepunch.Service, error)
ConnPushSupport counts peers by Push Support IdentifyReceived tracks metrics on receiving an identify response IdentifySent tracks metrics on sending an identify response TriggeredPushes counts IdentifyPushes triggered by event func NewMetricsTracer(opts ...MetricsTracerOption) MetricsTracer func WithMetricsTracer(tr MetricsTracer) Option
func WithRegisterer(reg prometheus.Registerer) MetricsTracerOption func NewMetricsTracer(opts ...MetricsTracerOption) MetricsTracer
ObservedAddrManager maps connection's local multiaddrs to their externally observable multiaddress Addrs return all activated observed addresses AddrsFor return all activated observed addresses associated with the given (resolved) listen address. (*ObservedAddrManager) Close() error Record enqueues an observation for recording *ObservedAddrManager : github.com/prometheus/common/expfmt.Closer *ObservedAddrManager : io.Closer func NewObservedAddrManager(listenAddrs, hostAddrs func() []ma.Multiaddr, interfaceListenAddrs func() ([]ma.Multiaddr, error), normalize func(ma.Multiaddr) ma.Multiaddr) (*ObservedAddrManager, error)
Option is an option function for identify. func DisableObservedAddrManager() Option func DisableSignedPeerRecord() Option func ProtocolVersion(s string) Option func UserAgent(ua string) Option func WithMetricsTracer(tr MetricsTracer) Option func WithTimeout(timeout time.Duration) Option func NewIDService(h host.Host, opts ...Option) (*idService, error)
Package-Level Functions (total 11)
DisableObservedAddrManager disables the observed address manager. It also effectively disables the nat emitter and EvtNATDeviceTypeChanged
DisableSignedPeerRecord disables populating signed peer records on the outgoing Identify response and ONLY sends the unsigned addresses.
HasConsistentTransport returns true if the address 'a' shares a protocol set with any address in the green set. This is used to check if a given address might be one of the addresses a peer is listening on.
NewIDService constructs a new *idService and activates it by attaching its stream handler to the given host.Host.
NewObservedAddrManager returns a new address manager using peerstore.OwnObservedAddressTTL as the TTL.
ProtocolVersion sets the protocol version string that will be used to identify the family of protocols used by the peer.
UserAgent sets the user agent this node will identify itself with to peers.
WithTimeout sets the timeout for identify interactions.
Package-Level Variables (only one)
ActivationThresh sets how many times an address must be seen as "activated" and therefore advertised to other peers as an address that the local peer can be contacted on. The "seen" events expire by default after 40 minutes (OwnObservedAddressTTL * ActivationThreshold). The are cleaned up during the GC rounds set by GCInterval.
Package-Level Constants (total 4)
DefaultTimeout for all id interactions, incoming / outgoing, id / id-push.
ID is the protocol.ID of version 1.0.0 of the identify service.
IDPush is the protocol.ID of the Identify push protocol. It sends full identify messages containing the current state of the peer.
ServiceName is the default identify service name