factories

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: AGPL-3.0 Imports: 39 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuilderFactory

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

func NewBuilderFactory

func NewBuilderFactory(
	db *badger.DB,
	protoState protocol.State,
	mainChainHeaders storage.Headers,
	trace module.Tracer,
	metrics module.CollectionMetrics,
	pusher network.Engine,
	log zerolog.Logger,
	opts ...builder.Opt,
) (*BuilderFactory, error)

func (*BuilderFactory) Create

func (f *BuilderFactory) Create(
	clusterState clusterstate.State,
	clusterHeaders storage.Headers,
	clusterPayloads storage.ClusterPayloads,
	pool mempool.Transactions,
	epoch uint64,
) (module.Builder, *finalizer.Finalizer, error)

type ClusterStateFactory

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

func NewClusterStateFactory

func NewClusterStateFactory(
	db *badger.DB,
	metrics module.CacheMetrics,
	tracer module.Tracer,
) (*ClusterStateFactory, error)

type ComplianceEngineFactory added in v0.29.0

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

func NewComplianceEngineFactory added in v0.29.0

func NewComplianceEngineFactory(
	log zerolog.Logger,
	net network.EngineRegistry,
	me module.Local,
	colMetrics module.CollectionMetrics,
	engMetrics module.EngineMetrics,
	mempoolMetrics module.MempoolMetrics,
	protoState protocol.State,
	transactions storage.Transactions,
	config modulecompliance.Config,
) (*ComplianceEngineFactory, error)

NewComplianceEngineFactory returns a new collection compliance engine factory.

func (*ComplianceEngineFactory) Create added in v0.29.0

func (f *ComplianceEngineFactory) Create(
	hotstuffMetrics module.HotstuffMetrics,
	notifier hotstuff.ProposalViolationConsumer,
	clusterState cluster.MutableState,
	headers storage.Headers,
	payloads storage.ClusterPayloads,
	syncCore *chainsync.Core,
	hot module.HotStuff,
	voteAggregator hotstuff.VoteAggregator,
	timeoutAggregator hotstuff.TimeoutAggregator,
	validator hotstuff.Validator,
) (*compliance.Engine, error)

type EpochComponentsFactory

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

func NewEpochComponentsFactory

func NewEpochComponentsFactory(
	me module.Local,
	pools *epochs.TransactionPools,
	builder *BuilderFactory,
	state *ClusterStateFactory,
	hotstuff *HotStuffFactory,
	compliance *ComplianceEngineFactory,
	syncCore *SyncCoreFactory,
	sync *SyncEngineFactory,
	messageHub *MessageHubFactory,
) *EpochComponentsFactory

func (*EpochComponentsFactory) Create

func (factory *EpochComponentsFactory) Create(
	epoch protocol.Epoch,
) (
	state cluster.State,
	compliance component.Component,
	sync module.ReadyDoneAware,
	hotstuff module.HotStuff,
	voteAggregator hotstuff.VoteAggregator,
	timeoutAggregator hotstuff.TimeoutAggregator,
	messageHub component.Component,
	err error,
)

type HotStuffFactory

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

func NewHotStuffFactory

func NewHotStuffFactory(
	log zerolog.Logger,
	me module.Local,
	db *badger.DB,
	protoState protocol.State,
	engineMetrics module.EngineMetrics,
	mempoolMetrics module.MempoolMetrics,
	createMetrics HotStuffMetricsFunc,
	opts ...consensus.Option,
) (*HotStuffFactory, error)

func (*HotStuffFactory) Create

func (f *HotStuffFactory) Create(
	cluster protocol.Cluster,
	clusterState cluster.State,
	metrics module.HotstuffMetrics,
	builder module.Builder,
	headers storage.Headers,
	hotstuffModules *consensus.HotstuffModules,
) (module.HotStuff, error)

func (*HotStuffFactory) CreateModules added in v0.23.9

func (f *HotStuffFactory) CreateModules(
	epoch protocol.Epoch,
	cluster protocol.Cluster,
	clusterState cluster.State,
	headers storage.Headers,
	payloads storage.ClusterPayloads,
	updater module.Finalizer,
) (*consensus.HotstuffModules, module.HotstuffMetrics, error)

type HotStuffMetricsFunc added in v0.20.0

type HotStuffMetricsFunc func(chainID flow.ChainID) module.HotstuffMetrics

type MessageHubFactory added in v0.29.0

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

func NewMessageHubFactory added in v0.29.0

func NewMessageHubFactory(log zerolog.Logger,
	net network.EngineRegistry,
	me module.Local,
	engineMetrics module.EngineMetrics,
	protoState protocol.State) *MessageHubFactory

func (*MessageHubFactory) Create added in v0.29.0

func (f *MessageHubFactory) Create(
	clusterState cluster.State,
	payloads storage.ClusterPayloads,
	hotstuff module.HotStuff,
	compliance collection.Compliance,
	hotstuffModules *consensus.HotstuffModules,
) (*message_hub.MessageHub, error)

type SyncCoreFactory added in v0.29.0

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

func NewSyncCoreFactory added in v0.29.0

func NewSyncCoreFactory(
	log zerolog.Logger,
	conf chainsync.Config,
) (*SyncCoreFactory, error)

func (*SyncCoreFactory) Create added in v0.29.0

func (f *SyncCoreFactory) Create(chainID flow.ChainID) (*chainsync.Core, error)

type SyncEngineFactory

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

func NewSyncEngineFactory

func NewSyncEngineFactory(
	log zerolog.Logger,
	metrics module.EngineMetrics,
	net network.EngineRegistry,
	me module.Local,
) (*SyncEngineFactory, error)

func (*SyncEngineFactory) Create

func (f *SyncEngineFactory) Create(
	participants flow.IdentityList,
	state cluster.State,
	blocks storage.ClusterBlocks,
	core *chainsync.Core,
	comp collection.Compliance,
) (*syncengine.Engine, error)

Jump to

Keyboard shortcuts

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