components

package
v1.7.11 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: GPL-3.0 Imports: 104 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClose = errors.New("error while closing inner components")

ErrClose signals that a close error occurred

Functions

func AggregateErrors

func AggregateErrors(errorStrings []string, baseError error) error

AggregateErrors can aggregate all provided error strings into a single error variable

func CreateBootstrapComponents

func CreateBootstrapComponents(args ArgsBootstrapComponentsHolder) (*bootstrapComponentsHolder, error)

CreateBootstrapComponents will create a new instance of bootstrap components holder

func CreateCoreComponents

func CreateCoreComponents(args ArgsCoreComponentsHolder) (*coreComponentsHolder, error)

CreateCoreComponents will create a new instance of factory.CoreComponentsHolder

func CreateCryptoComponents

func CreateCryptoComponents(args ArgsCryptoComponentsHolder) (*cryptoComponentsHolder, error)

CreateCryptoComponents will create a new instance of cryptoComponentsHolder

func CreateDataComponents

func CreateDataComponents(args ArgsDataComponentsHolder) (*dataComponentsHolder, error)

CreateDataComponents will create the data components holder

func CreateMemUnit

func CreateMemUnit() storage.Storer

CreateMemUnit creates a new in-memory storage unit

func CreateMemUnitForTries

func CreateMemUnitForTries() storage.Storer

CreateMemUnitForTries returns a special type of storer used on tries instances

func CreateNetworkComponents

func CreateNetworkComponents(network SyncedBroadcastNetworkHandler) (*networkComponentsHolder, error)

CreateNetworkComponents creates a new networkComponentsHolder instance

func CreateProcessComponents

func CreateProcessComponents(args ArgsProcessComponentsHolder) (*processComponentsHolder, error)

CreateProcessComponents will create the process components holder

func CreateStateComponents

func CreateStateComponents(args ArgsStateComponents) (*stateComponentsHolder, error)

CreateStateComponents will create the state components holder

func CreateStatusComponents

func CreateStatusComponents(shardID uint32, appStatusHandler core.AppStatusHandler, statusPollingIntervalSec int, external config.ExternalConfig) (*statusComponentsHolder, error)

CreateStatusComponents will create a new instance of status components holder

func CreateStatusCoreComponents

func CreateStatusCoreComponents(configs config.Configs, coreComponents factory.CoreComponentsHolder) (*statusCoreComponentsHolder, error)

CreateStatusCoreComponents will create a new instance of factory.StatusCoreComponentsHandler

func CreateStore

func CreateStore(numOfShards uint32) dataRetriever.StorageService

CreateStore creates a storage service for shard nodes

func NewCloseHandler

func NewCloseHandler() *closeHandler

NewCloseHandler create a new closeHandler instance

func NewInstantBroadcastMessenger

func NewInstantBroadcastMessenger(broadcastMessenger consensus.BroadcastMessenger, shardCoordinator sharding.Coordinator) (*instantBroadcastMessenger, error)

NewInstantBroadcastMessenger creates a new instance of type instantBroadcastMessenger

func NewManualRoundHandler

func NewManualRoundHandler(genesisTimeStamp int64, roundDuration time.Duration, initialRound int64) *manualRoundHandler

NewManualRoundHandler returns a manual round handler instance

func NewSyncedBroadcastNetwork

func NewSyncedBroadcastNetwork() *syncedBroadcastNetwork

NewSyncedBroadcastNetwork creates a new synced broadcast network

func NewSyncedMessenger

func NewSyncedMessenger(network SyncedBroadcastNetworkHandler) (*syncedMessenger, error)

NewSyncedMessenger creates a new synced network messenger

func NewTestOnlyProcessingNode

func NewTestOnlyProcessingNode(args ArgsTestOnlyProcessingNode) (*testOnlyProcessingNode, error)

NewTestOnlyProcessingNode creates a new instance of a node that is able to only process transactions

Types

type APIConfigurator

type APIConfigurator interface {
	RestApiInterface(shardID uint32) string
}

APIConfigurator defines what an api configurator should be able to do

type ArgsBootstrapComponentsHolder

type ArgsBootstrapComponentsHolder struct {
	CoreComponents       factory.CoreComponentsHolder
	CryptoComponents     factory.CryptoComponentsHolder
	NetworkComponents    factory.NetworkComponentsHolder
	StatusCoreComponents factory.StatusCoreComponentsHolder
	WorkingDir           string
	FlagsConfig          config.ContextFlagsConfig
	ImportDBConfig       config.ImportDbConfig
	PrefsConfig          config.Preferences
	Config               config.Config
	ShardIDStr           string
}

ArgsBootstrapComponentsHolder will hold the components needed for the bootstrap components holders

type ArgsCoreComponentsHolder

type ArgsCoreComponentsHolder struct {
	Config              config.Config
	EnableEpochsConfig  config.EnableEpochs
	RoundsConfig        config.RoundConfig
	EconomicsConfig     config.EconomicsConfig
	RatingConfig        config.RatingsConfig
	ChanStopNodeProcess chan endProcess.ArgEndProcess
	InitialRound        int64
	NodesSetupPath      string
	GasScheduleFilename string
	NumShards           uint32
	WorkingDir          string

	MinNodesPerShard  uint32
	MinNodesMeta      uint32
	RoundDurationInMs uint64
}

ArgsCoreComponentsHolder will hold arguments needed for the core components holder

type ArgsCryptoComponentsHolder

type ArgsCryptoComponentsHolder struct {
	Config                      config.Config
	EnableEpochsConfig          config.EnableEpochs
	Preferences                 config.Preferences
	CoreComponentsHolder        factory.CoreComponentsHolder
	AllValidatorKeysPemFileName string
	BypassTxSignatureCheck      bool
}

ArgsCryptoComponentsHolder holds all arguments needed to create a crypto components holder

type ArgsDataComponentsHolder

type ArgsDataComponentsHolder struct {
	Chain              data.ChainHandler
	StorageService     dataRetriever.StorageService
	DataPool           dataRetriever.PoolsHolder
	InternalMarshaller marshal.Marshalizer
}

ArgsDataComponentsHolder will hold the components needed for data components

type ArgsProcessComponentsHolder

type ArgsProcessComponentsHolder struct {
	CoreComponents       factory.CoreComponentsHolder
	CryptoComponents     factory.CryptoComponentsHolder
	NetworkComponents    factory.NetworkComponentsHolder
	BootstrapComponents  factory.BootstrapComponentsHolder
	StateComponents      factory.StateComponentsHolder
	DataComponents       factory.DataComponentsHolder
	StatusComponents     factory.StatusComponentsHolder
	StatusCoreComponents factory.StatusCoreComponentsHolder
	NodesCoordinator     nodesCoordinator.NodesCoordinator

	EpochConfig              config.EpochConfig
	RoundConfig              config.RoundConfig
	ConfigurationPathsHolder config.ConfigurationPathsHolder
	FlagsConfig              config.ContextFlagsConfig
	ImportDBConfig           config.ImportDbConfig
	PrefsConfig              config.Preferences
	Config                   config.Config
	EconomicsConfig          config.EconomicsConfig
	SystemSCConfig           config.SystemSmartContractsConfig

	GenesisNonce uint64
	GenesisRound uint64
}

ArgsProcessComponentsHolder will hold the components needed for process components

type ArgsStateComponents

type ArgsStateComponents struct {
	Config         config.Config
	CoreComponents factory.CoreComponentsHolder
	StatusCore     factory.StatusCoreComponentsHolder
	StoreService   dataRetriever.StorageService
	ChainHandler   chainData.ChainHandler
}

ArgsStateComponents will hold the components needed for state components

type ArgsTestOnlyProcessingNode

type ArgsTestOnlyProcessingNode struct {
	Configs      config.Configs
	APIInterface APIConfigurator

	ChanStopNodeProcess    chan endProcess.ArgEndProcess
	SyncedBroadcastNetwork SyncedBroadcastNetworkHandler

	InitialRound           int64
	InitialNonce           uint64
	GasScheduleFilename    string
	NumShards              uint32
	ShardIDStr             string
	BypassTxSignatureCheck bool
	MinNodesPerShard       uint32
	MinNodesMeta           uint32
	RoundDurationInMillis  uint64
}

ArgsTestOnlyProcessingNode represents the DTO struct for the NewTestOnlyProcessingNode constructor function

type SyncedBroadcastNetworkHandler

type SyncedBroadcastNetworkHandler interface {
	RegisterMessageReceiver(handler messageReceiver, pid core.PeerID)
	Broadcast(pid core.PeerID, topic string, buff []byte)
	SendDirectly(from core.PeerID, topic string, buff []byte, to core.PeerID) error
	GetConnectedPeers() []core.PeerID
	GetConnectedPeersOnTopic(topic string) []core.PeerID
	IsInterfaceNil() bool
}

SyncedBroadcastNetworkHandler defines the synced network interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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