package identify
Import Path
github.com/libp2p/go-libp2p/p2p/protocol/identify (on go.dev)
Dependency Relation
imports 29 packages, and imported by 5 packages
Package-Level Type Names (total 4)
( 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.
( 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
Option is an option function for identify.
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 9)
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.
func NewMetricsTracer(opts ...MetricsTracerOption) MetricsTracer
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.
func WithMetricsTracer(tr MetricsTracer) Option
WithTimeout sets the timeout for identify interactions.
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
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |