Documentation ¶
Overview ¶
Package sniffer contains sniffer components which can be wired into a libp2p dht node by proxying the datastore.
The canonical implementation thereof can be found in: https://github.com/ipfs-search/ipfs-sniffer
If all you want is to sniff CID's, you probably want to use a `factory` to facilitate the setup of the sniffer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { LastSeenExpiration time.Duration // Expiration time for the last-seen resources LastSeenPruneLen int // Cleanup expired resources from the last-seen LoggerTimeout time.Duration // Throw timeout error when no log messages arrive BufferSize uint // Size of the channels buffering between yielder, filter and adder }
Config holds configuration for a Sniffer.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default configuration for a Sniffer.
type Sniffer ¶
type Sniffer struct { *instr.Instrumentation // contains filtered or unexported fields }
Sniffer allows sniffing Batching datastore's events, effectively allowing sniffing of the IPFS DHT. To effectively use the Sniffer, the proxied datastore needs to be acquired by calling `Batching()` on the Sniffer.
func New ¶
func New(cfg *Config, ds datastore.Batching, pub queue.PublisherFactory, i *instr.Instrumentation) (*Sniffer, error)
New creates a new Sniffer based on a datastore, or returns an error.