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() 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() IDiscovery
type IDiscovery ¶ added in v1.2.0
type IDiscovery interface{}
Click to show internal directories.
Click to hide internal directories.