Documentation ¶
Index ¶
- Constants
- func DefaultListenAddrs() []multiaddr.Multiaddr
- func UnicastListenAddrs() []multiaddr.Multiaddr
- type BootstrapPeerDebugInfo
- type ConnectionInfo
- type HostConfig
- type IDService
- type P2p
- func (p *P2p) AnnouncedAs() []multiaddr.Multiaddr
- func (p *P2p) Bootstrap() error
- func (p *P2p) BootstrapPeersStats() (int, int)
- func (p *P2p) BootstrapPeersStatsDetailed() map[string]BootstrapPeerDebugInfo
- func (p *P2p) ClearBackoff(peerID peer.ID)
- func (p *P2p) Close() error
- func (p *P2p) ConnectPeer(ctx context.Context, peerID peer.ID) error
- func (p *P2p) ConnectedPeersCount() int
- func (p *P2p) ConnectionsLastTrimAgo() time.Duration
- func (p *P2p) FindPeer(ctx context.Context, id peer.ID) (peer.AddrInfo, error)
- func (p *P2p) Host() host.Host
- func (p *P2p) IDService() IDService
- func (p *P2p) InitHost(hostConfig HostConfig) (host.Host, error)
- func (p *P2p) IsConnected(peerID peer.ID) bool
- func (p *P2p) MaintainBackgroundConnections(ctx context.Context, interval time.Duration, ...)
- func (p *P2p) NetworkSize() (int32, error)
- func (p *P2p) NetworkStats() metrics.Stats
- func (p *P2p) NetworkStatsByPeer() map[peer.ID]metrics.Stats
- func (p *P2p) NetworkStatsByProtocol() map[protocol.ID]metrics.Stats
- func (p *P2p) NetworkStatsForPeer(peerID peer.ID) metrics.Stats
- func (p *P2p) NewStream(ctx context.Context, id peer.ID, proto protocol.ID) (network.Stream, error)
- func (p *P2p) NewStreamWithDedicatedConn(ctx context.Context, id peer.ID, proto protocol.ID) (network.Stream, error)
- func (p *P2p) OpenConnectionsCount() int
- func (p *P2p) OpenStreamStats() map[protocol.ID]map[string]int
- func (p *P2p) OpenStreamsCount() int64
- func (p *P2p) OwnObservedAddrs() []multiaddr.Multiaddr
- func (p *P2p) PeerConnectionsInfo(peerID peer.ID) []ConnectionInfo
- func (p *P2p) PeerID() peer.ID
- func (p *P2p) PeerUserAgent(peerID peer.ID) string
- func (p *P2p) PeersWithAddrsCount() int
- func (p *P2p) ProtectPeer(id peer.ID)
- func (p *P2p) Reachability() network.Reachability
- func (p *P2p) RoutingTablePeers() []kbucket.PeerInfo
- func (p *P2p) RoutingTableSize() int
- func (p *P2p) SubscribeConnectionEvents(onConnected, onDisconnected func(network.Network, network.Conn))
- func (p *P2p) UnprotectPeer(id peer.ID)
- func (p *P2p) Uptime() time.Duration
Constants ¶
View Source
const ( DesiredRelays = 2 RelayBootDelay = 20 * time.Second DHTProtocolPrefix protocol.ID = "/awl" )
Variables ¶
This section is empty.
Functions ¶
func DefaultListenAddrs ¶
func DefaultListenAddrs() []multiaddr.Multiaddr
func UnicastListenAddrs ¶
func UnicastListenAddrs() []multiaddr.Multiaddr
Types ¶
type BootstrapPeerDebugInfo ¶
type ConnectionInfo ¶
type HostConfig ¶
type HostConfig struct { PrivKeyBytes []byte ListenAddrs []multiaddr.Multiaddr UserAgent string BootstrapPeers []peer.AddrInfo Libp2pOpts []libp2p.Option ConnManager struct { LowWater int HighWater int GracePeriod time.Duration } Peerstore peerstore.Peerstore DHTDatastore ds.Batching DHTOpts []dht.Option }
type P2p ¶
type P2p struct {
// contains filtered or unexported fields
}
func (*P2p) AnnouncedAs ¶
func (p *P2p) AnnouncedAs() []multiaddr.Multiaddr
func (*P2p) BootstrapPeersStats ¶
BootstrapPeersStats returns total peers count and connected count.
func (*P2p) BootstrapPeersStatsDetailed ¶
func (p *P2p) BootstrapPeersStatsDetailed() map[string]BootstrapPeerDebugInfo
func (*P2p) ClearBackoff ¶
func (*P2p) ConnectedPeersCount ¶
func (*P2p) ConnectionsLastTrimAgo ¶
func (*P2p) MaintainBackgroundConnections ¶
func (*P2p) NetworkSize ¶ added in v0.8.0
func (*P2p) NetworkStats ¶
func (*P2p) NetworkStatsByProtocol ¶
func (*P2p) NewStreamWithDedicatedConn ¶ added in v0.11.0
func (*P2p) OpenConnectionsCount ¶
func (*P2p) OpenStreamsCount ¶
func (*P2p) OwnObservedAddrs ¶
func (p *P2p) OwnObservedAddrs() []multiaddr.Multiaddr
func (*P2p) PeerConnectionsInfo ¶
func (p *P2p) PeerConnectionsInfo(peerID peer.ID) []ConnectionInfo
func (*P2p) PeersWithAddrsCount ¶
func (*P2p) ProtectPeer ¶
func (*P2p) Reachability ¶
func (p *P2p) Reachability() network.Reachability
func (*P2p) RoutingTablePeers ¶
func (p *P2p) RoutingTablePeers() []kbucket.PeerInfo
func (*P2p) RoutingTableSize ¶
func (*P2p) SubscribeConnectionEvents ¶
func (*P2p) UnprotectPeer ¶
Click to show internal directories.
Click to hide internal directories.