node_builder

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: AGPL-3.0 Imports: 51 Imported by: 2

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 AccessNodeBuilder

type AccessNodeBuilder interface {
	cmd.NodeBuilder

	// IsStaked returns True is this is a staked Access Node, False otherwise
	IsStaked() bool

	// ParticipatesInUnstakedNetwork returns True if this is a staked Access node which also participates
	// in the unstaked network acting as an upstream for other unstaked access nodes, False otherwise.
	ParticipatesInUnstakedNetwork() bool

	// Build defines all of the Access node's components and modules.
	Build() AccessNodeBuilder
}

type AccessNodeConfig

type AccessNodeConfig struct {
	ExecutionNodeAddress string // deprecated
	HistoricalAccessRPCs []access.AccessAPIClient
	// contains filtered or unexported fields
}

AccessNodeConfig 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 DefaultAccessNodeConfig

func DefaultAccessNodeConfig() *AccessNodeConfig

DefaultAccessNodeConfig defines all the default values for the AccessNodeConfig

type FlowAccessNodeBuilder

type FlowAccessNodeBuilder struct {
	*cmd.FlowNodeBuilder
	*AccessNodeConfig

	// components
	UnstakedLibP2PNode *p2p.Node
	UnstakedNetwork    *p2p.Network

	FollowerState              protocol.MutableState
	SyncCore                   *synchronization.Core
	RpcEng                     *rpc.Engine
	FinalizationDistributor    *pubsub.FinalizationDistributor
	FinalizedHeader            *synceng.FinalizedHeaderCache
	CollectionRPC              access.AccessAPIClient
	TransactionTimings         *stdmap.TransactionTimings
	CollectionsToMarkFinalized *stdmap.Times
	CollectionsToMarkExecuted  *stdmap.Times
	BlocksToMarkExecuted       *stdmap.Times
	TransactionMetrics         module.TransactionMetrics
	PingMetrics                module.PingMetrics
	Committee                  hotstuff.Committee
	Finalized                  *flow.Header
	Pending                    []*flow.Header
	FollowerCore               module.HotStuffFollower

	// engines
	IngestEng   *ingestion.Engine
	RequestEng  *requester.Engine
	FollowerEng *followereng.Engine
	SyncEng     *synceng.Engine
	// contains filtered or unexported fields
}

FlowAccessNodeBuilder provides the common functionality needed to bootstrap a Flow staked and unstaked access node It is composed of the FlowNodeBuilder, the AccessNodeConfig and contains all the components and modules needed for the staked and unstaked access nodes

func FlowAccessNode

func FlowAccessNode(opts ...Option) *FlowAccessNodeBuilder

func (*FlowAccessNodeBuilder) Build

func (*FlowAccessNodeBuilder) BuildConsensusFollower

func (builder *FlowAccessNodeBuilder) BuildConsensusFollower() AccessNodeBuilder

func (*FlowAccessNodeBuilder) IsStaked

func (builder *FlowAccessNodeBuilder) IsStaked() bool

func (*FlowAccessNodeBuilder) ParseFlags

func (builder *FlowAccessNodeBuilder) ParseFlags()

func (*FlowAccessNodeBuilder) ParticipatesInUnstakedNetwork

func (builder *FlowAccessNodeBuilder) ParticipatesInUnstakedNetwork() bool

type Option

type Option func(*AccessNodeConfig)

func WithBaseOptions

func WithBaseOptions(baseOptions []cmd.Option) Option

func WithBootStrapPeers

func WithBootStrapPeers(bootstrapNodes ...*flow.Identity) Option

func WithUnstakedNetworkBindAddr

func WithUnstakedNetworkBindAddr(bindAddr string) Option

type StakedAccessNodeBuilder

type StakedAccessNodeBuilder struct {
	*FlowAccessNodeBuilder
}

StakedAccessNodeBuilder builds a staked access node. The staked access node can optionally participate in the unstaked network publishing data for the unstaked access node downstream.

func NewStakedAccessNodeBuilder

func NewStakedAccessNodeBuilder(anb *FlowAccessNodeBuilder) *StakedAccessNodeBuilder

func (*StakedAccessNodeBuilder) Build

func (*StakedAccessNodeBuilder) Initialize

func (builder *StakedAccessNodeBuilder) Initialize() cmd.NodeBuilder

type UnstakedAccessNodeBuilder

type UnstakedAccessNodeBuilder struct {
	*FlowAccessNodeBuilder
}

func NewUnstakedAccessNodeBuilder

func NewUnstakedAccessNodeBuilder(anb *FlowAccessNodeBuilder) *UnstakedAccessNodeBuilder

func (*UnstakedAccessNodeBuilder) Initialize

func (builder *UnstakedAccessNodeBuilder) Initialize() cmd.NodeBuilder

Jump to

Keyboard shortcuts

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