Documentation ¶
Index ¶
Constants ¶
View Source
const ( MTU = 1500 // Max packet size, 1500 is typical for home WiFi, preventing packet fragmentation. FANOUT = 2 // Number of peers randomly selected when selecting more than one. PROBE = 8 // Inverse of probability that an untrusted peer is randomly selected. GETNPEER = 2 // Limit of peers in a PEER message. Prevents Eclipse attack. DELAY = 5039 // Epochs until new peers may be randomly selected. Prevents Sybil attack. PING = 14197 // Epochs until silent peers are pinged with a GETPEER message. DROP = 131071 // Epochs until silent peers are dropped from the peer table. SEED = 3 // Epochs between sending one random dat to one random peer, excluding edges. PUSH = 127 // Epcohs between sending the newest dat to one random peer, excluding edges. EDGE = 3889 // Epochs between sending one random dat to one random edge peer. )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cfg ¶
type Cfg struct { LstnAddr *net.UDPAddr // Listening address:port Edges []netip.AddrPort // Bootstrap peers Epoch time.Duration // Base cycle, lower runs faster, using more bandwidth DatCap, FilterCap uint // Dat map & cuckoo filter capacity Pull uint64 // Interval between pulling a random dat from a random peer (optional anonymity) Prune uint64 // Interval between refreshing dat & peer maps Log chan<- []byte // Log messages }
Click to show internal directories.
Click to hide internal directories.