genesis

package
v0.0.7-alphanet Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: GPL-3.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidGenesisPath    = errors.New("can't open genesis file")
	ErrInvalidGenesisJson    = errors.New("malformed genesis json structure")
	ErrIncompleteGenesisJson = errors.New("incomplete genesis json")
	ErrInvalidGenesisConfig  = errors.New("invalid genesis config. Failed to pass tests")

	ErrNoEmbeddedGenesis = errors.New("the codebase has no embedded genesis")
)

Functions

func CheckFieldsExist

func CheckFieldsExist(g *GenesisConfig) error

func CheckGenesis

func CheckGenesis(g *GenesisConfig) error

func CheckGenesisCheckSum

func CheckGenesisCheckSum(g *GenesisConfig, expected types.Hash) error

CheckGenesisCheckSum ensures that the hash of the account blocks don't change during the build.

func CheckPillarBalance

func CheckPillarBalance(g *GenesisConfig) error

func CheckPlasmaInfo

func CheckPlasmaInfo(g *GenesisConfig) error

func CheckSwapAccount

func CheckSwapAccount(g *GenesisConfig) error

func CheckTokenTotalSupply

func CheckTokenTotalSupply(g *GenesisConfig) error

func MakeEmbeddedGenesisConfig

func MakeEmbeddedGenesisConfig() (store.Genesis, error)

func NewGenesis

func NewGenesis(config *GenesisConfig) store.Genesis

func ReadGenesisConfigFromFile

func ReadGenesisConfigFromFile(genesisFile string) (store.Genesis, error)

Types

type GenesisBlockConfig

type GenesisBlockConfig struct {
	Address     types.Address
	BalanceList map[types.ZenonTokenStandard]*big.Int
}

type GenesisBlocksConfig

type GenesisBlocksConfig struct {
	Blocks []*GenesisBlockConfig
}

type GenesisConfig

type GenesisConfig struct {
	ChainIdentifier     uint64
	ExtraData           string
	GenesisTimestampSec int64
	SporkAddress        *types.Address

	PillarConfig *PillarContractConfig
	TokenConfig  *TokenContractConfig
	PlasmaConfig *PlasmaContractConfig
	SwapConfig   *SwapContractConfig
	SporkConfig  *SporkConfig

	GenesisBlocks *GenesisBlocksConfig
}

type PillarContractConfig

type PillarContractConfig struct {
	Pillars       []*definition.PillarInfo
	Delegations   []*definition.DelegationInfo
	LegacyEntries []*definition.LegacyPillarEntry
}

type PlasmaContractConfig

type PlasmaContractConfig struct {
	Fusions []*definition.FusionInfo
}

type SporkConfig

type SporkConfig struct {
	Sporks []*definition.Spork
}

type SwapContractConfig

type SwapContractConfig struct {
	Entries []*definition.SwapAssets
}

type TokenContractConfig

type TokenContractConfig struct {
	Tokens []*definition.TokenInfo
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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