peerdiscovery

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoveryTypeToString

func DiscoveryTypeToString(t models.DiscoveryType) string

func StringToDiscoveryType

func StringToDiscoveryType(s string) models.DiscoveryType

Types

type CSV

type CSV struct {
	// contains filtered or unexported fields
}

func NewCSVPeerDiscoverer

func NewCSVPeerDiscoverer(file string) (*CSV, error)

func (*CSV) Close

func (c *CSV) Close() error

func (*CSV) Run

func (c *CSV) Run() (chan *models.ENR, error)

func (*CSV) Type

func (c *CSV) Type() models.DiscoveryType

type Discoverer

type Discoverer interface {
	// Run starts the peer discovery process or get the nodes from the file
	Run() (chan *models.ENR, error)
	// Type returns that
	Type() models.DiscoveryType
	// Close the peer discovery
	Close()
}

type Discv4

type Discv4 struct {
	// contains filtered or unexported fields
}

func NewDiscv4

func NewDiscv4(ctx context.Context, port int) (*Discv4, error)

func (*Discv4) Close

func (d *Discv4) Close()

func (*Discv4) Run

func (d *Discv4) Run() (chan *models.ENR, error)

func (*Discv4) Type

func (c *Discv4) Type() models.DiscoveryType

type PeerDiscovery

type PeerDiscovery struct {
	// contains filtered or unexported fields
}

Main peer discovery service that identifies new peers in the network

func NewPeerDiscovery

func NewPeerDiscovery(ctx context.Context, discv Discoverer, database *db.PostgresDBService) (*PeerDiscovery, error)

func (*PeerDiscovery) Close

func (d *PeerDiscovery) Close()

func (*PeerDiscovery) Run

func (d *PeerDiscovery) Run() error

Jump to

Keyboard shortcuts

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