bootstrap

package
v1.0.107 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: GPL-3.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEpochStartBootstrap

func NewEpochStartBootstrap(args ArgsEpochStartBootstrap) (*epochStartBootstrap, error)

NewEpochStartBootstrap will return a new instance of epochStartBootstrap

func NewEpochStartMetaBlockProcessor

func NewEpochStartMetaBlockProcessor(
	messenger Messenger,
	handler RequestHandler,
	marshalizer marshal.Marshalizer,
	hasher hashing.Hasher,
	consensusPercentage uint8,
) (*epochStartMetaBlockProcessor, error)

NewEpochStartMetaBlockProcessor will return a interceptor processor for epoch start meta block

func NewEpochStartMetaSyncer

func NewEpochStartMetaSyncer(args ArgsNewEpochStartMetaSyncer) (*epochStartMetaSyncer, error)

NewEpochStartMetaSyncer will return a new instance of epochStartMetaSyncer

func NewMetaStorageHandler

func NewMetaStorageHandler(
	generalConfig config.Config,
	shardCoordinator sharding.Coordinator,
	pathManagerHandler storage.PathManagerHandler,
	marshalizer marshal.Marshalizer,
	hasher hashing.Hasher,
	currentEpoch uint32,
	uint64Converter typeConverters.Uint64ByteSliceConverter,
) (*metaStorageHandler, error)

NewMetaStorageHandler will return a new instance of metaStorageHandler

func NewShardStorageHandler

func NewShardStorageHandler(
	generalConfig config.Config,
	shardCoordinator sharding.Coordinator,
	pathManagerHandler storage.PathManagerHandler,
	marshalizer marshal.Marshalizer,
	hasher hashing.Hasher,
	currentEpoch uint32,
	uint64Converter typeConverters.Uint64ByteSliceConverter,
) (*shardStorageHandler, error)

NewShardStorageHandler will return a new instance of shardStorageHandler

func NewSyncValidatorStatus

func NewSyncValidatorStatus(args ArgsNewSyncValidatorStatus) (*syncValidatorStatus, error)

NewSyncValidatorStatus creates a new validator status process component

Types

type ArgsEpochStartBootstrap

type ArgsEpochStartBootstrap struct {
	DestinationShardAsObserver uint32
	WorkingDir                 string
	DefaultDBPath              string
	DefaultEpochString         string
	DefaultShardString         string
	TrieStorageManagers        map[string]data.StorageManager
	PublicKey                  crypto.PublicKey
	Marshalizer                marshal.Marshalizer
	TxSignMarshalizer          marshal.Marshalizer
	Hasher                     hashing.Hasher
	Messenger                  Messenger
	GeneralConfig              config.Config
	EconomicsData              *economics.EconomicsData
	SingleSigner               crypto.SingleSigner
	BlockSingleSigner          crypto.SingleSigner
	KeyGen                     crypto.KeyGenerator
	BlockKeyGen                crypto.KeyGenerator
	GenesisNodesConfig         sharding.GenesisNodesSetupHandler
	GenesisShardCoordinator    sharding.Coordinator
	PathManager                storage.PathManagerHandler
	Rater                      sharding.ChanceComputer
	TrieContainer              state.TriesHolder
	Uint64Converter            typeConverters.Uint64ByteSliceConverter
	NodeShuffler               sharding.NodesShuffler
	Rounder                    epochStart.Rounder
	AddressPubkeyConverter     state.PubkeyConverter
}

ArgsEpochStartBootstrap holds the arguments needed for creating an epoch start data provider component

type ArgsNewEpochStartMetaSyncer

type ArgsNewEpochStartMetaSyncer struct {
	RequestHandler    RequestHandler
	Messenger         Messenger
	Marshalizer       marshal.Marshalizer
	TxSignMarshalizer marshal.Marshalizer
	ShardCoordinator  sharding.Coordinator
	KeyGen            crypto.KeyGenerator
	BlockKeyGen       crypto.KeyGenerator
	Hasher            hashing.Hasher
	Signer            crypto.SingleSigner
	BlockSigner       crypto.SingleSigner
	ChainID           []byte
	EconomicsData     *economics.EconomicsData
	WhitelistHandler  process.WhiteListHandler
	AddressPubkeyConv state.PubkeyConverter
}

ArgsNewEpochStartMetaSyncer -

type ArgsNewSyncValidatorStatus

type ArgsNewSyncValidatorStatus struct {
	DataPool           dataRetriever.PoolsHolder
	Marshalizer        marshal.Marshalizer
	Hasher             hashing.Hasher
	RequestHandler     process.RequestHandler
	ChanceComputer     sharding.ChanceComputer
	GenesisNodesConfig sharding.GenesisNodesSetupHandler
	NodeShuffler       sharding.NodesShuffler
	PubKey             []byte
	ShardIdAsObserver  uint32
}

ArgsNewSyncValidatorStatus holds the arguments needed for creating a new validator status process component

type ComponentsNeededForBootstrap

type ComponentsNeededForBootstrap struct {
	EpochStartMetaBlock *block.MetaBlock
	PreviousEpochStart  *block.MetaBlock
	ShardHeader         *block.Header
	NodesConfig         *sharding.NodesCoordinatorRegistry
	Headers             map[string]data.HeaderHandler
	ShardCoordinator    sharding.Coordinator
	UserAccountTries    map[string]data.Trie
	PeerAccountTries    map[string]data.Trie
	PendingMiniBlocks   map[string]*block.MiniBlock
}

ComponentsNeededForBootstrap holds the components which need to be initialized from network

type EpochStartInterceptor

type EpochStartInterceptor interface {
	process.Interceptor
	GetEpochStartMetaBlock(target int, epoch uint32) (*block.MetaBlock, error)
}

EpochStartInterceptor defines the methods to sync an epoch start metablock

type Messenger

type Messenger interface {
	dataRetriever.MessageHandler
	dataRetriever.TopicHandler
	UnregisterMessageProcessor(topic string) error
	UnregisterAllMessageProcessors() error
	ConnectedPeers() []p2p.PeerID
}

Messenger defines which methods a p2p messenger should implement

type Parameters

type Parameters struct {
	Epoch       uint32
	SelfShardId uint32
	NumOfShards uint32
}

Parameters defines the DTO for the result produced by the bootstrap component

type RequestHandler

type RequestHandler interface {
	RequestStartOfEpochMetaBlock(epoch uint32)
	SetNumPeersToQuery(topic string, intra int, cross int) error
	GetNumPeersToQuery(topic string) (int, int, error)
	IsInterfaceNil() bool
}

RequestHandler defines which methods a request handler should implement

type StartInEpochNodesCoordinator

type StartInEpochNodesCoordinator interface {
	EpochStartPrepare(metaHdr data.HeaderHandler, body data.BodyHandler)
	NodesCoordinatorToRegistry() *sharding.NodesCoordinatorRegistry
	ShardIdForEpoch(epoch uint32) (uint32, error)
	IsInterfaceNil() bool
}

StartInEpochNodesCoordinator defines the methods to process and save nodesCoordinator information to storage

type StartOfEpochNodesConfigHandler

type StartOfEpochNodesConfigHandler interface {
	NodesConfigFromMetaBlock(currMetaBlock *block.MetaBlock, prevMetaBlock *block.MetaBlock) (*sharding.NodesCoordinatorRegistry, uint32, error)
	IsInterfaceNil() bool
}

StartOfEpochNodesConfigHandler defines the methods to process nodesConfig from epoch start metablocks

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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