genesis

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

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