discv5

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscoveryV5

type DiscoveryV5 struct {
	sync.Mutex

	discovery.Discovery

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

func NewDiscoveryV5

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

func (*DiscoveryV5) Advertise

func (d *DiscoveryV5) Advertise(ctx context.Context, ns string, opts ...discovery.Option) (time.Duration, error)

func (*DiscoveryV5) FindPeers

func (d *DiscoveryV5) FindPeers(ctx context.Context, topic string, opts ...discovery.Option) (<-chan peer.AddrInfo, error)

func (*DiscoveryV5) Start

func (d *DiscoveryV5) Start() error

func (*DiscoveryV5) Stop

func (d *DiscoveryV5) Stop()

type DiscoveryV5Option

type DiscoveryV5Option func(*discV5Parameters)

func DefaultOptions

func DefaultOptions() []DiscoveryV5Option

func WithAdvertiseAddr

func WithAdvertiseAddr(addr net.IP) DiscoveryV5Option

func WithAutoUpdate

func WithAutoUpdate(autoUpdate bool) DiscoveryV5Option

func WithBootnodes

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

func WithUDPPort

func WithUDPPort(port int) DiscoveryV5Option

Jump to

Keyboard shortcuts

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