chainSimulator

package
v1.7.12 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: GPL-3.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateBlsPrivateKeys

func GenerateBlsPrivateKeys(numOfKeys int) ([][]byte, []string, error)

GenerateBlsPrivateKeys will generate bls keys

func NewChainSimulator

func NewChainSimulator(args ArgsChainSimulator) (*simulator, error)

NewChainSimulator will create a new instance of simulator

func NewChainSimulatorFacade

func NewChainSimulatorFacade(chainSimulator ChainSimulator) (*chainSimulatorFacade, error)

NewChainSimulatorFacade returns the chain simulator facade

Types

type ArgsChainSimulator

type ArgsChainSimulator struct {
	BypassTxSignatureCheck   bool
	TempDir                  string
	PathToInitialConfig      string
	NumOfShards              uint32
	MinNodesPerShard         uint32
	MetaChainMinNodes        uint32
	NumNodesWaitingListShard uint32
	NumNodesWaitingListMeta  uint32
	GenesisTimestamp         int64
	InitialRound             int64
	InitialEpoch             uint32
	InitialNonce             uint64
	RoundDurationInMillis    uint64
	RoundsPerEpoch           core.OptionalUint64
	ApiInterface             components.APIConfigurator
	AlterConfigsFunction     func(cfg *config.Configs)
}

ArgsChainSimulator holds the arguments needed to create a new instance of simulator

type ChainHandler

type ChainHandler interface {
	IncrementRound()
	CreateNewBlock() error
	IsInterfaceNil() bool
}

ChainHandler defines what a chain handler should be able to do

type ChainSimulator

type ChainSimulator interface {
	GenerateBlocks(numOfBlocks int) error
	GetNodeHandler(shardID uint32) process.NodeHandler
	IsInterfaceNil() bool
}

ChainSimulator defines what a chain simulator should be able to do

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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