genesis

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGenesisBlockFromTrie

func NewGenesisBlockFromTrie(t *trie.Trie) (*types.Header, error)

NewGenesisBlockFromTrie creates a genesis block from the provided trie

func NewTrieFromGenesis

func NewTrieFromGenesis(g *Genesis) (*trie.Trie, error)

NewTrieFromGenesis creates a new trie from the raw genesis data

Types

type Data

type Data struct {
	Name       string
	ID         string
	Bootnodes  [][]byte
	ProtocolID string
}

Data defines the genesis file data formatted for trie storage

type Fields

type Fields struct {
	Raw [2]map[string]string
}

Fields stores genesis raw data

type Genesis

type Genesis struct {
	Name       string
	ID         string
	Bootnodes  []string
	ProtocolID string
	Genesis    Fields
}

Genesis stores the data parsed from the genesis configuration file

func NewGenesisFromJSON

func NewGenesisFromJSON(file string) (*Genesis, error)

NewGenesisFromJSON parses a JSON formatted genesis file

func (*Genesis) GenesisData

func (g *Genesis) GenesisData() *Data

GenesisData formats genesis for trie storage

func (*Genesis) GenesisFields

func (g *Genesis) GenesisFields() Fields

GenesisFields returns the genesis fields including genesis raw data

Jump to

Keyboard shortcuts

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