factory

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2019 License: GPL-3.0 Imports: 68 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BlsHashSize specifies the hash size for using bls scheme
	BlsHashSize = 16

	// BlsConsensusType specifies te signature scheme used in the consensus
	BlsConsensusType = "bls"

	// BnConsensusType specifies te signature scheme used in the consensus
	BnConsensusType = "bn"

	// MaxTxsToRequest specifies the maximum number of txs to request
	MaxTxsToRequest = 100
)

Variables

This section is empty.

Functions

func GetPkEncoded

func GetPkEncoded(pubKey crypto.PublicKey) string

GetPkEncoded returns the encoded public key

func GetSigningParams

func GetSigningParams(
	ctx *cli.Context,
	log *logger.Logger,
	skName string,
	skIndexName string,
	skPemFileName string,
	suite crypto.Suite,
) (keyGen crypto.KeyGenerator, privKey crypto.PrivateKey, pubKey crypto.PublicKey, err error)

GetSigningParams returns a key generator, a private key, and a public key

func NewCoreComponentsFactoryArgs

func NewCoreComponentsFactoryArgs(config *config.Config, uniqueID string) *coreComponentsFactoryArgs

NewCoreComponentsFactoryArgs initializes the arguments necessary for creating the core components

func NewCryptoComponentsFactoryArgs

func NewCryptoComponentsFactoryArgs(
	ctx *cli.Context,
	config *config.Config,
	nodesConfig *sharding.NodesSetup,
	shardCoordinator sharding.Coordinator,
	keyGen crypto.KeyGenerator,
	privKey crypto.PrivateKey,
	log *logger.Logger,
	initialBalancesSkPemFileName string,
	txSignSkName string,
	txSignSkIndexName string,
) *cryptoComponentsFactoryArgs

NewCryptoComponentsFactoryArgs initializes the arguments necessary for creating the crypto components

func NewDataComponentsFactoryArgs

func NewDataComponentsFactoryArgs(config *config.Config, shardCoordinator sharding.Coordinator, core *Core, uniqueID string) *dataComponentsFactoryArgs

NewDataComponentsFactoryArgs initializes the arguments necessary for creating the data components

func NewProcessComponentsFactoryArgs

func NewProcessComponentsFactoryArgs(
	genesisConfig *sharding.Genesis,
	nodesConfig *sharding.NodesSetup,
	syncer ntp.SyncTimer,
	shardCoordinator sharding.Coordinator,
	data *Data,
	core *Core,
	crypto *Crypto,
	state *State,
	network *Network,
	coreServiceContainer serviceContainer.Core,
) *processComponentsFactoryArgs

NewProcessComponentsFactoryArgs initializes the arguments necessary for creating the process components

func NewSeedRandReader added in v1.0.3

func NewSeedRandReader(seed []byte) *seedRandReader

NewSeedRandReader will return a new instance of a seed-based reader

func NewStateComponentsFactoryArgs

func NewStateComponentsFactoryArgs(
	config *config.Config,
	genesisConfig *sharding.Genesis,
	shardCoordinator sharding.Coordinator,
	core *Core,
) *stateComponentsFactoryArgs

NewStateComponentsFactoryArgs initializes the arguments necessary for creating the state components

Types

type Core

type Core struct {
	Hasher                   hashing.Hasher
	Marshalizer              marshal.Marshalizer
	Trie                     data.Trie
	Uint64ByteSliceConverter typeConverters.Uint64ByteSliceConverter
}

Core struct holds the core components of the Elrond protocol

func CoreComponentsFactory

func CoreComponentsFactory(args *coreComponentsFactoryArgs) (*Core, error)

CoreComponentsFactory creates the core components

type Crypto

type Crypto struct {
	TxSingleSigner crypto.SingleSigner
	SingleSigner   crypto.SingleSigner
	MultiSigner    crypto.MultiSigner
	TxSignKeyGen   crypto.KeyGenerator
	TxSignPrivKey  crypto.PrivateKey
	TxSignPubKey   crypto.PublicKey
	InitialPubKeys map[uint32][]string
}

Crypto struct holds the crypto components of the Elrond protocol

func CryptoComponentsFactory

func CryptoComponentsFactory(args *cryptoComponentsFactoryArgs) (*Crypto, error)

CryptoComponentsFactory creates the crypto components

type Data

Data struct holds the data components of the Elrond protocol

func DataComponentsFactory

func DataComponentsFactory(args *dataComponentsFactoryArgs) (*Data, error)

DataComponentsFactory creates the data components

type Network

type Network struct {
	NetMessenger p2p.Messenger
}

Network struct holds the network components of the Elrond protocol

func NetworkComponentsFactory

func NetworkComponentsFactory(p2pConfig *config.P2PConfig, log *logger.Logger, core *Core) (*Network, error)

NetworkComponentsFactory creates the network components

type Process

type Process struct {
	InterceptorsContainer process.InterceptorsContainer
	ResolversFinder       dataRetriever.ResolversFinder
	Rounder               consensus.Rounder
	ForkDetector          process.ForkDetector
	BlockProcessor        process.BlockProcessor
	BlockTracker          process.BlocksTracker
}

Process struct holds the process components of the Elrond protocol

func ProcessComponentsFactory

func ProcessComponentsFactory(args *processComponentsFactoryArgs) (*Process, error)

ProcessComponentsFactory creates the process components

type State

type State struct {
	AddressConverter  state.AddressConverter
	AccountsAdapter   state.AccountsAdapter
	InBalanceForShard map[string]*big.Int
}

State struct holds the state components of the Elrond protocol

func StateComponentsFactory

func StateComponentsFactory(args *stateComponentsFactoryArgs) (*State, error)

StateComponentsFactory creates the state components

Jump to

Keyboard shortcuts

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