genesis

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_STATE_ROOT string = "b40ba0dac43dd7bfa8e390c05e9da481a9598bed0689ef81c6eb52e86de6deac"

DEFAULT_STATE_ROOT is the state root result of "rusk make state".

Variables

This section is empty.

Functions

func Decode added in v0.5.0

func Decode() *block.Block

Decode marshals a genesis block into a buffer.

func Generate

func Generate(c Config) *block.Block

Generate a genesis block. The constitution of the block depends on the passed config.

Types

type Config

type Config struct {
	Transactions []transactions.ContractCall
	// contains filtered or unexported fields
}

Config is a list of configuration parameters for generating a genesis block.

func GetPresetConfig

func GetPresetConfig(name string) (Config, error)

GetPresetConfig fetches a preset configuration for a genesis block for the given name. Returns an error, if the name does not match any existing presets.

func NewConfig

func NewConfig(timestamp int64, seed []byte, txs []transactions.ContractCall) (Config, error)

NewConfig will construct a new genesis config. This function does sanity checks on all passed parameters, and ensures a correct genesis block can be produced from them.

Jump to

Keyboard shortcuts

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