discv5

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoDiscV5Listener = errors.New("no discv5 listener")

Functions

This section is empty.

Types

type DiscoveryV5

type DiscoveryV5 struct {
	sync.RWMutex

	NAT nat.Interface
	// contains filtered or unexported fields
}

func NewDiscoveryV5

func NewDiscoveryV5(host host.Host, priv *ecdsa.PrivateKey, localnode *enode.LocalNode, peerConnector PeerConnector, log *zap.Logger, opts ...DiscoveryV5Option) (*DiscoveryV5, error)

func (*DiscoveryV5) IsStarted

func (d *DiscoveryV5) IsStarted() bool

func (*DiscoveryV5) Iterator added in v0.4.0

func (d *DiscoveryV5) Iterator() (enode.Iterator, error)

func (*DiscoveryV5) Node

func (d *DiscoveryV5) Node() *enode.Node

func (*DiscoveryV5) SetBootnodes

func (d *DiscoveryV5) SetBootnodes(nodes []*enode.Node) error

func (*DiscoveryV5) Start

func (d *DiscoveryV5) Start(ctx context.Context) error

func (*DiscoveryV5) Stop

func (d *DiscoveryV5) Stop()

type DiscoveryV5Option

type DiscoveryV5Option func(*discV5Parameters)

func DefaultOptions

func DefaultOptions() []DiscoveryV5Option

func WithAdvertiseAddr

func WithAdvertiseAddr(addr []multiaddr.Multiaddr) DiscoveryV5Option

func WithAutoUpdate

func WithAutoUpdate(autoUpdate bool) DiscoveryV5Option

func WithBootnodes

func WithBootnodes(bootnodes []*enode.Node) DiscoveryV5Option

func WithUDPPort

func WithUDPPort(port uint) DiscoveryV5Option

type PeerConnector added in v0.4.0

type PeerConnector interface {
	PeerChannel() chan<- peer.AddrInfo
}

Jump to

Keyboard shortcuts

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