canonicallog

package
v0.23.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2022 License: MIT Imports: 8 Imported by: 19

Documentation

Index

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

func LogPeerStatus(sampleRate int, p peer.ID, peerAddr multiaddr.Multiaddr, keyVals ...string)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL