Versions in this module Expand all Collapse all v0 v0.0.0 May 17, 2024 Changes in this version + const MetachainShardId + var ErrCouldNotParsePubKey = errors.New("could not parse node's public key") + var ErrInvalidNumberOfShards = errors.New("the number of shards must be greater than zero") + var ErrInvalidShardId = errors.New("shard id must be smaller than the total number of shards") + var ErrMinNodesPerShardSmallerThanConsensusSize = errors.New("minimum nodes per shard is smaller than consensus group size") + var ErrNegativeOrZeroConsensusGroupSize = errors.New("negative or zero consensus group size") + var ErrNilAddressConverter = errors.New("trying to set nil address converter") + var ErrNilShardCoordinator = errors.New("trying to set nil shard coordinator") + var ErrNoPubKeys = errors.New("no public keys defined") + var ErrNoValidPublicKey = errors.New("public key is not valid, it is missing from genesis file") + var ErrNodesSizeSmallerThanMinNoOfNodes = errors.New("length of nodes defined is smaller than min nodes per shard required") + var ErrShardIdOutOfRange = errors.New("shard id out of range") + func NewMultiShardCoordinator(numberOfShards, selfId uint32) (*multiShardCoordinator, error) + type Coordinator interface + CommunicationIdentifier func(destShardID uint32) string + ComputeId func(address state.AddressContainer) uint32 + NumberOfShards func() uint32 + SameShard func(firstAddress, secondAddress state.AddressContainer) bool + SelfId func() uint32 + type Genesis struct + InitialBalances []*InitialBalance + func NewGenesisConfig(genesisFilePath string) (*Genesis, error) + func (g *Genesis) InitialNodesBalances(shardCoordinator Coordinator, adrConv state.AddressConverter) (map[string]*big.Int, error) + type InitialBalance struct + Balance string + PubKey string + type InitialNode struct + PubKey string + type NodesSetup struct + ConsensusGroupSize uint32 + InitialNodes []*InitialNode + MetaChainActive bool + MetaChainConsensusGroupSize uint32 + MetaChainMinNodes uint32 + MinNodesPerShard uint32 + RoundDuration uint64 + StartTime int64 + func NewNodesSetup(nodesFilePath string, numOfNodes uint64) (*NodesSetup, error) + func (ns *NodesSetup) GetShardIDForPubKey(pubKey []byte) (uint32, error) + func (ns *NodesSetup) InitialNodesPubKeys() map[uint32][]string + func (ns *NodesSetup) InitialNodesPubKeysForShard(shardId uint32) ([]string, error) + func (ns *NodesSetup) IsMetaChainActive() bool + func (ns *NodesSetup) NumberOfShards() uint32 + type OneShardCoordinator struct + func (osc *OneShardCoordinator) CommunicationIdentifier(destShardID uint32) string + func (osc *OneShardCoordinator) ComputeId(address state.AddressContainer) uint32 + func (osc *OneShardCoordinator) NumberOfShards() uint32 + func (osc *OneShardCoordinator) SameShard(firstAddress, secondAddress state.AddressContainer) bool + func (osc *OneShardCoordinator) SelfId() uint32