node_builder

package
v0.29.0-stable-cadence-4 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: AGPL-3.0 Imports: 72 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BootstrapIdentities

func BootstrapIdentities(addresses []string, keys []string) (flow.IdentityList, error)

BootstrapIdentities converts the bootstrap node addresses and keys to a Flow Identity list where each Flow Identity is initialized with the passed address, the networking key and the Node ID set to ZeroID, role set to Access, 0 stake and no staking key.

Types

type ObserverServiceBuilder

type ObserverServiceBuilder struct {
	*cmd.FlowNodeBuilder
	*ObserverServiceConfig

	// components
	LibP2PNode              p2p.LibP2PNode
	FollowerState           stateprotocol.MutableState
	SyncCore                *chainsync.Core
	RpcEng                  *rpc.Engine
	FinalizationDistributor *pubsub.FinalizationDistributor
	FinalizedHeader         *synceng.FinalizedHeaderCache
	Committee               hotstuff.Committee
	Finalized               *flow.Header
	Pending                 []*flow.Header
	FollowerCore            module.HotStuffFollower
	ExecutionDataDownloader execution_data.Downloader
	ExecutionDataRequester  state_synchronization.ExecutionDataRequester // for the observer, the sync engine participants provider is the libp2p peer store which is not
	// available until after the network has started. Hence, a factory function that needs to be called just before
	// creating the sync engine
	SyncEngineParticipantsProviderFactory func() module.IdentifierProvider

	// engines
	FollowerEng *followereng.Engine
	SyncEng     *synceng.Engine
	// contains filtered or unexported fields
}

ObserverServiceBuilder provides the common functionality needed to bootstrap a Flow observer service It is composed of the FlowNodeBuilder, the ObserverServiceConfig and contains all the components and modules needed for the observers

func NewFlowObserverServiceBuilder

func NewFlowObserverServiceBuilder(opts ...Option) *ObserverServiceBuilder

func (*ObserverServiceBuilder) Build

func (builder *ObserverServiceBuilder) Build() (cmd.Node, error)

Build enqueues the sync engine and the follower engine for the observer. Currently, the observer only runs the follower engine.

func (*ObserverServiceBuilder) BuildConsensusFollower

func (builder *ObserverServiceBuilder) BuildConsensusFollower() cmd.NodeBuilder

func (*ObserverServiceBuilder) BuildExecutionDataRequester

func (builder *ObserverServiceBuilder) BuildExecutionDataRequester() *ObserverServiceBuilder

func (*ObserverServiceBuilder) InitIDProviders

func (builder *ObserverServiceBuilder) InitIDProviders()

func (*ObserverServiceBuilder) Initialize

func (builder *ObserverServiceBuilder) Initialize() error

func (*ObserverServiceBuilder) ParseFlags

func (builder *ObserverServiceBuilder) ParseFlags() error

type ObserverServiceConfig

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

ObserverServiceConfig defines all the user defined parameters required to bootstrap an access node For a node running as a standalone process, the config fields will be populated from the command line params, while for a node running as a library, the config fields are expected to be initialized by the caller.

func DefaultObserverServiceConfig

func DefaultObserverServiceConfig() *ObserverServiceConfig

DefaultObserverServiceConfig defines all the default values for the ObserverServiceConfig

type Option

type Option func(*ObserverServiceConfig)

Jump to

Keyboard shortcuts

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