discovery

package
v1.1.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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,
	discoverCfg discoveryConfig,
	network *network.NetworkSubmodule,
	chainStore *chain.Store,
	messageStore *chain.MessageStore,
) (*DiscoverySubmodule, error)

NewDiscoverySubmodule creates a new discovery submodule.

func (*DiscoverySubmodule) API

func (discovery *DiscoverySubmodule) API() apiface.IDiscovery

API create a discovery api implement

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.

func (*DiscoverySubmodule) V0API added in v0.9.7

func (discovery *DiscoverySubmodule) V0API() apiface.IDiscovery

Jump to

Keyboard shortcuts

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