Documentation
¶
Overview ¶
Package bootstrap is responsible for randomly probing and linearly scanning the local network (single interface) for other running instances.
In every scanning cycle all configured UDP ports are checked (to prevent slowdowns due to large config space).
Since the heartbeats are on UDP, each one is flagged as a beat request or response (i.e. reply to requests, but don't loop indefinitely).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bootstrapper ¶
type Bootstrapper struct {
// contains filtered or unexported fields
}
Bootstrapper state for a single network interface.
func New ¶
func New(ipnet *net.IPNet, magic []byte, node *big.Int, overlay int) (*Bootstrapper, chan *Event, error)
Creates a new bootstrapper, configuring to listen on the given interface for for incoming requests and scan the same interface for other peers. The magic is used to filter multiple Iris networks in the same physical network, while the overlay is the TCP listener port of the DHT.
func (*Bootstrapper) Boot ¶
func (bs *Bootstrapper) Boot() error
Starts accepting bootstrap events and initiates peer discovery.
func (*Bootstrapper) SetMode ¶
func (bs *Bootstrapper) SetMode(startup bool)
Switches between startup (fast) and maintenance (slow) sampling speeds.
func (*Bootstrapper) Terminate ¶
func (bs *Bootstrapper) Terminate() error
Closes the bootstrap listener and terminates all probing procedures.