Documentation
¶
Index ¶
- func PinPeers(clusters *cluster.KnownClusters, connMgr connmgr.ConnManager) error
- type Config
- type ConnGater
- func (c *ConnGater) InterceptAccept(_ network.ConnMultiaddrs) (allow bool)
- func (c *ConnGater) InterceptAddrDial(_ peer.ID, addr multiaddr.Multiaddr) (allow bool)
- func (c *ConnGater) InterceptPeerDial(_ peer.ID) (allow bool)
- func (c *ConnGater) InterceptSecured(_ network.Direction, id peer.ID, _ network.ConnMultiaddrs) (allow bool)
- func (c *ConnGater) InterceptUpgraded(_ network.Conn) (allow bool, reason control.DisconnectReason)
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PinPeers ¶
func PinPeers(clusters *cluster.KnownClusters, connMgr connmgr.ConnManager) error
PinPeers marks all DV peers as protected peers, preventing disconnects.
Types ¶
type Config ¶
type ConnGater ¶
type ConnGater struct {
PeerIDs map[peer.ID]struct{} // known nodes by libp2p peer ID
Networks *netutil.Netlist
}
ConnGater filters incoming connections to known DV clients.
func NewConnGaterForClusters ¶
func NewConnGaterForClusters(clusters cluster.KnownClusters, networks *netutil.Netlist) *ConnGater
NewConnGaterForClusters constructs a conn gater that limits access to nodes part of the provided clusters.
func (*ConnGater) InterceptAccept ¶
func (c *ConnGater) InterceptAccept(_ network.ConnMultiaddrs) (allow bool)
func (*ConnGater) InterceptAddrDial ¶
func (*ConnGater) InterceptPeerDial ¶
InterceptPeerDial does nothing.
func (*ConnGater) InterceptSecured ¶
func (c *ConnGater) InterceptSecured(_ network.Direction, id peer.ID, _ network.ConnMultiaddrs) (allow bool)
InterceptSecured rejects nodes with a peer ID that isn't part of any known DV.
func (*ConnGater) InterceptUpgraded ¶
InterceptUpgraded does nothing.
Click to show internal directories.
Click to hide internal directories.