Documentation ¶
Index ¶
- func LogMisbehavingPeer(p peer.ID, peerAddr multiaddr.Multiaddr, component string, err error, ...)
- func LogMisbehavingPeerNetAddr(p peer.ID, peerAddr net.Addr, component string, originalErr error, msg string)
- func LogPeerStatus(sampleRate int, p peer.ID, peerAddr multiaddr.Multiaddr, keyVals ...string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogMisbehavingPeer ¶
func LogMisbehavingPeer(p peer.ID, peerAddr multiaddr.Multiaddr, component string, err error, msg string)
LogMisbehavingPeer is the canonical way to log a misbehaving peer. Protocols should use this to identify a misbehaving peer to allow the end user to easily identify these nodes across protocols and libp2p.
func LogMisbehavingPeerNetAddr ¶
func LogMisbehavingPeerNetAddr(p peer.ID, peerAddr net.Addr, component string, originalErr error, msg string)
LogMisbehavingPeerNetAddr is the canonical way to log a misbehaving peer. Protocols should use this to identify a misbehaving peer to allow the end user to easily identify these nodes across protocols and libp2p.
func LogPeerStatus ¶
LogPeerStatus logs any useful information about a peer. It takes in a sample rate and will only log one in every sampleRate messages (randomly). This is useful in surfacing events that are normal in isolation, but may be abnormal in large quantities. For example, a successful connection from an IP address is normal. 10,000 connections from that same IP address is not normal. libp2p itself does nothing besides emitting this log. Hook this up to another tool like fail2ban to action on the log.
Types ¶
This section is empty.