Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bootstrap ¶
type Bootstrap struct {
// contains filtered or unexported fields
}
Bootstrap enforces required number of outbound connections.
func NewBootstrap ¶
NewBootstrap create Bootstrap instance.
type Discovery ¶
Discovery is an interface that actively searches for peers when Bootstrap is called.
type EventSpacemeshPeer ¶
type EventSpacemeshPeer struct { PID peer.ID Direction network.Direction Connectedness network.Connectedness }
EventSpacemeshPeer is emitted when peer is connected after handshake or disconnected.
type Opt ¶
type Opt func(*Peers)
Opt to modify peers instance.
func WithContext ¶
WithContext sets parent context on Peers.
func WithNodeReporter ¶
func WithNodeReporter(f func()) Opt
WithNodeReporter sets callback to report node status. Callback is invoked after new peer joins or disconnects.
type Peers ¶
type Peers struct {
// contains filtered or unexported fields
}
Peers is used by protocols to manage available peers.
func StartPeers ¶
StartPeers creates a Peers instance that is registered to `s`'s events and starts it.
Click to show internal directories.
Click to hide internal directories.