Documentation ¶
Index ¶
- Constants
- type DiscoveryV5
- func (d *DiscoveryV5) Advertise(ctx context.Context, ns string, opts ...discovery.Option) (time.Duration, error)
- func (d *DiscoveryV5) FindNodes(ctx context.Context, topic string, opts ...discovery.Option) ([]PeerRecord, error)
- func (d *DiscoveryV5) FindPeers(ctx context.Context, topic string, opts ...discovery.Option) (<-chan peer.AddrInfo, error)
- func (d *DiscoveryV5) IsStarted() bool
- func (d *DiscoveryV5) Node() *enode.Node
- func (d *DiscoveryV5) Start() error
- func (d *DiscoveryV5) Stop()
- type DiscoveryV5Option
- type PeerRecord
Constants ¶
View Source
const MaxPeersToDiscover = 600
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscoveryV5 ¶
type DiscoveryV5 struct { sync.RWMutex discovery.Discovery NAT nat.Interface // contains filtered or unexported fields }
func NewDiscoveryV5 ¶
func NewDiscoveryV5(ctx context.Context, host host.Host, priv *ecdsa.PrivateKey, localnode *enode.LocalNode, log *zap.Logger, opts ...DiscoveryV5Option) (*DiscoveryV5, error)
func (*DiscoveryV5) FindNodes ¶
func (d *DiscoveryV5) FindNodes(ctx context.Context, topic string, opts ...discovery.Option) ([]PeerRecord, error)
func (*DiscoveryV5) IsStarted ¶
func (d *DiscoveryV5) IsStarted() bool
func (*DiscoveryV5) Node ¶
func (d *DiscoveryV5) Node() *enode.Node
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
Click to show internal directories.
Click to hide internal directories.