Versions in this module Expand all Collapse all v1 v1.10.3 Dec 16, 2024 v1.10.2 Dec 15, 2024 Changes in this version + const MaxMessageHandlers + const MaxMessageSize + const SetAsideForConsensus + const SetAsideOtherwise + func ConstructMessage(content []byte) []byte + func NewGater(disablePrivateIPScan bool) connmgr.ConnectionGater + type ConnectCallback func(net libp2p_network.Network, conn libp2p_network.Conn) error + type ConnectCallbacks struct + func (a *ConnectCallbacks) Add(cb ConnectCallback) + func (a *ConnectCallbacks) GetAll() []ConnectCallback + type Counter struct + func (c *Counter) LogRecvMessage(size int64) + func (c *Counter) LogSentMessage(size int64) + type DisconnectCallback func(conn libp2p_network.Conn) error + type DisconnectCallbacks struct + func (a *DisconnectCallbacks) Add(cb DisconnectCallback) + func (a *DisconnectCallbacks) GetAll() []DisconnectCallback + type Gater struct + func (gater Gater) InterceptAccept(network.ConnMultiaddrs) (allow bool) + func (gater Gater) InterceptAddrDial(p peer.ID, m ma.Multiaddr) (allow bool) + func (gater Gater) InterceptPeerDial(p peer.ID) (allow bool) + func (gater Gater) InterceptSecured(network.Direction, peer.ID, network.ConnMultiaddrs) (allow bool) + func (gater Gater) InterceptUpgraded(network.Conn) (allow bool, reason control.DisconnectReason) + type Host interface + AddPeer func(*Peer) error + AddStreamProtocol func(protocols ...sttypes.Protocol) + Close func() error + ConnectHostPeer func(Peer) error + GetDiscovery func() discovery.Discovery + GetID func() libp2p_peer.ID + GetOrJoin func(topic string) (*libp2p_pubsub.Topic, error) + GetP2PHost func() libp2p_host.Host + GetPeerCount func() int + GetSelfPeer func() Peer + ListBlockedPeer func() []libp2p_peer.ID + ListPeer func(topic string) []libp2p_peer.ID + ListTopic func() []string + PeerConnectivity func() (int, int, int) + PubSub func() *libp2p_pubsub.PubSub + SendMessageToGroups func(groups []nodeconfig.GroupID, msg []byte) error + Start func() error + func NewHost(cfg HostConfig) (Host, error) + type HostConfig struct + BLSKey libp2p_crypto.PrivKey + BootNodes []string + ConnManagerHighWatermark int + ConnManagerLowWatermark int + DataStoreFile *string + DisablePrivateIPScan bool + DiscConcurrency int + ForceReachabilityPublic bool + MaxConnPerIP int + MaxPeers int64 + Self *Peer + WaitForEachPeerToConnect bool + type HostV2 struct + func (host *HostV2) AddPeer(p *Peer) error + func (host *HostV2) AddStreamProtocol(protocols ...sttypes.Protocol) + func (host *HostV2) Close() error + func (host *HostV2) ClosedStream(net libp2p_network.Network, stream libp2p_network.Stream) + func (host *HostV2) ConnectHostPeer(peer Peer) error + func (host *HostV2) Connected(net libp2p_network.Network, conn libp2p_network.Conn) + func (host *HostV2) Disconnected(net libp2p_network.Network, conn libp2p_network.Conn) + func (host *HostV2) GetDiscovery() discovery.Discovery + func (host *HostV2) GetID() libp2p_peer.ID + func (host *HostV2) GetOrJoin(topic string) (*libp2p_pubsub.Topic, error) + func (host *HostV2) GetP2PHost() libp2p_host.Host + func (host *HostV2) GetPeerCount() int + func (host *HostV2) GetSelfPeer() Peer + func (host *HostV2) ListBlockedPeer() []libp2p_peer.ID + func (host *HostV2) ListPeer(topic string) []libp2p_peer.ID + func (host *HostV2) ListTopic() []string + func (host *HostV2) Listen(net libp2p_network.Network, addr ma.Multiaddr) + func (host *HostV2) ListenClose(net libp2p_network.Network, addr ma.Multiaddr) + func (host *HostV2) OpenedStream(net libp2p_network.Network, stream libp2p_network.Stream) + func (host *HostV2) PeerConnectivity() (int, int, int) + func (host *HostV2) Peerstore() libp2p_peerstore.Peerstore + func (host *HostV2) PubSub() *libp2p_pubsub.PubSub + func (host *HostV2) SendMessageToGroups(groups []nodeconfig.GroupID, msg []byte) (err error) + func (host *HostV2) SetConnectCallback(callback ConnectCallback) + func (host *HostV2) SetDisconnectCallback(callback DisconnectCallback) + func (host *HostV2) Start() error + type NamedTopic struct + Name string + Topic *libp2p_pubsub.Topic + type Peer struct + Addrs []ma.Multiaddr + ConsensusPubKey *bls.PublicKey + IP string + PeerID libp2p_peer.ID + Port string