package host

Import Path
	github.com/libp2p/go-libp2p/core/host (on go.dev)

Dependency Relation
	imports 8 packages, and imported by 17 packages

Involved Source Files helpers.go Package host provides the core Host interface for libp2p. Host represents a single libp2p node in a peer-to-peer network.
Package-Level Type Names (only one)
/* sort by: | */
Host is an object participating in a p2p network, which implements protocols or provides services. It handles requests like a Server, and issues requests like a Client. It is called Host because it is both Server and Client (and Peer may be confusing). Addrs returns the listen addresses of the Host Close shuts down the host, its Network, and services. ConnManager returns this hosts connection manager Connect ensures there is a connection between this host and the peer with given peer.ID. Connect will absorb the addresses in pi into its internal peerstore. If there is not an active connection, Connect will issue a h.Network.Dial, and block until a connection is open, or an error is returned. EventBus returns the hosts eventbus ID returns the (local) peer.ID associated with this Host Mux returns the Mux multiplexing incoming streams to protocol handlers Network returns the Network interface of the Host NewStream opens a new stream to given peer p, and writes a p2p/protocol header with given ProtocolID. If there is no connection to p, attempts to create one. If ProtocolID is "", writes no header. (Thread-safe) Peerstore returns the Host's repository of Peer Addresses and Keys. RemoveStreamHandler removes a handler on the mux that was set by SetStreamHandler SetStreamHandler sets the protocol handler on the Host's Mux. This is equivalent to: host.Mux().SetHandler(proto, handler) (Thread-safe) SetStreamHandlerMatch sets the protocol handler on the Host's Mux using a matching function for protocol selection. *github.com/libp2p/go-libp2p/p2p/host/basic.BasicHost *github.com/libp2p/go-libp2p/p2p/host/blank.BlankHost *github.com/libp2p/go-libp2p/p2p/host/routed.RoutedHost Host : github.com/prometheus/common/expfmt.Closer Host : io.Closer func github.com/libp2p/go-libp2p.New(opts ...libp2p.Option) (Host, error) func github.com/libp2p/go-libp2p.NewWithoutDefaults(opts ...libp2p.Option) (Host, error) func github.com/libp2p/go-libp2p/config.(*Config).NewNode() (Host, error) func InfoFromHost(h Host) *peer.AddrInfo func github.com/libp2p/go-libp2p/p2p/discovery/backoff.NewBackoffConnector(h Host, cacheSize int, connectionTryDuration time.Duration, backoff backoff.BackoffFactory) (*backoff.BackoffConnector, error) func github.com/libp2p/go-libp2p/p2p/host/autonat.New(h Host, options ...autonat.Option) (autonat.AutoNAT, error) func github.com/libp2p/go-libp2p/p2p/host/autonat.NewAutoNATClient(h Host, addrFunc autonat.AddrFunc, mt autonat.MetricsTracer) autonat.Client func github.com/libp2p/go-libp2p/p2p/host/autorelay.NewAutoRelay(host Host, opts ...autorelay.Option) (*autorelay.AutoRelay, error) func github.com/libp2p/go-libp2p/p2p/host/relaysvc.NewRelayManager(host Host, opts ...relayv2.Option) *relaysvc.RelayManager func github.com/libp2p/go-libp2p/p2p/host/routed.Wrap(h Host, r routedhost.Routing) *routedhost.RoutedHost func github.com/libp2p/go-libp2p/p2p/protocol/autonatv2.New(dialerHost Host, opts ...autonatv2.AutoNATOption) (*autonatv2.AutoNAT, error) func github.com/libp2p/go-libp2p/p2p/protocol/autonatv2.(*AutoNAT).Start(h Host) error func github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/client.AddTransport(h Host, upgrader transport.Upgrader) error func github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/client.New(h Host, upgrader transport.Upgrader) (*client.Client, error) func github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/client.Reserve(ctx context.Context, h Host, ai peer.AddrInfo) (*client.Reservation, error) func github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/relay.New(h Host, opts ...relay.Option) (*relay.Relay, error) func github.com/libp2p/go-libp2p/p2p/protocol/holepunch.NewService(h Host, ids identify.IDService, listenAddrs func() []ma.Multiaddr, opts ...holepunch.Option) (*holepunch.Service, error) func github.com/libp2p/go-libp2p/p2p/protocol/identify.NewIDService(h Host, opts ...identify.Option) (*identify.idService, error) func github.com/libp2p/go-libp2p/p2p/protocol/ping.NewPingService(h Host) *ping.PingService func github.com/libp2p/go-libp2p/p2p/protocol/ping.Ping(ctx context.Context, h Host, p peer.ID) <-chan ping.Result func github.com/libp2p/go-libp2p-pubsub.DefaultGossipSubRouter(h Host) *pubsub.GossipSubRouter func github.com/libp2p/go-libp2p-pubsub.NewFloodSub(ctx context.Context, h Host, opts ...pubsub.Option) (*pubsub.PubSub, error) func github.com/libp2p/go-libp2p-pubsub.NewFloodsubWithProtocols(ctx context.Context, h Host, ps []protocol.ID, opts ...pubsub.Option) (*pubsub.PubSub, error) func github.com/libp2p/go-libp2p-pubsub.NewGossipSub(ctx context.Context, h Host, opts ...pubsub.Option) (*pubsub.PubSub, error) func github.com/libp2p/go-libp2p-pubsub.NewGossipSubWithRouter(ctx context.Context, h Host, rt pubsub.PubSubRouter, opts ...pubsub.Option) (*pubsub.PubSub, error) func github.com/libp2p/go-libp2p-pubsub.NewPubSub(ctx context.Context, h Host, rt pubsub.PubSubRouter, opts ...pubsub.Option) (*pubsub.PubSub, error) func github.com/libp2p/go-libp2p-pubsub.NewRandomSub(ctx context.Context, h Host, size int, opts ...pubsub.Option) (*pubsub.PubSub, error) func github.com/libp2p/go-libp2p-pubsub.NewRemoteTracer(ctx context.Context, host Host, pi peer.AddrInfo) (*pubsub.RemoteTracer, error)
Package-Level Functions (only one)
InfoFromHost returns a peer.AddrInfo struct with the Host's ID and all of its Addrs.