peerexchange

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Bootnodes            []string
	DataDir              string
	AdvertiseAddress     string // Address to advertise to a peers.
	MinPeers             int
	FastCrawl, SlowCrawl time.Duration
}

Config for Discovery.

type Discovery

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

Discovery is struct that holds the protocol components, the protocol definition, the addr book data structure and more.

func New

func New(logger log.Log, h host.Host, config Config) (*Discovery, error)

New creates a Discovery instance.

func (*Discovery) AdvertisedAddress

func (d *Discovery) AdvertisedAddress() ma.Multiaddr

AdvertisedAddress returns advertised address.

func (*Discovery) StartScan

func (d *Discovery) StartScan()

StartScan starts background goroutine to connect with known peers and scan for new ones.

func (*Discovery) Stop

func (d *Discovery) Stop()

Stop stops the discovery service.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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