discovery

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscoveryAPI

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

type DiscoverySubmodule

type DiscoverySubmodule struct {
	Bootstrapper   *discovery.Bootstrapper
	BootstrapReady *moresync.Latch

	// PeerTracker maintains a list of peers.
	PeerTracker *discovery.PeerTracker

	// HelloHandler handle peer connections for the "hello" protocol.
	HelloHandler *discovery.HelloProtocolHandler
	// HelloHandler handle peer connections for the "hello" protocol.
	ExchangeHandler exchange.Server
	ExchangeClient  exchange.Client

	PeerDiscoveryCallbacks []discovery.PeerDiscoveredCallback
	TipSetLoader           discovery.GetTipSetFunc
	// contains filtered or unexported fields
}

DiscoverySubmodule enhances the `Node` with peer discovery capabilities.

func NewDiscoverySubmodule

func NewDiscoverySubmodule(ctx context.Context,
	genesiGetter discoveryConfig,
	config *config.Config,
	network *network.NetworkSubmodule,
	chainStore *chain.Store,
	messageStore *chain.MessageStore,
) (*DiscoverySubmodule, error)

NewDiscoverySubmodule creates a new discovery submodule.

func (*DiscoverySubmodule) API

func (discovery *DiscoverySubmodule) API() *DiscoveryAPI

func (*DiscoverySubmodule) Start

func (discovery *DiscoverySubmodule) Start(offline bool) error

Start starts the discovery submodule for a node. It blocks until bootstrap satisfies the configured security conditions.

func (*DiscoverySubmodule) Stop

func (discovery *DiscoverySubmodule) Stop()

Stop stops the discovery submodule.

Jump to

Keyboard shortcuts

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