genesis

package
v0.0.0-...-481a8b4 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const KeyDelimiter = "/"

KeyDelimiter is used to separate module and key in the options

Variables

This section is empty.

Functions

func Load

func Load(app InitStater, filePath string) error

Load parses the genesis file and sets the initial state based on that

Types

type Doc

type Doc struct {
	Accounts []json.RawMessage `json:"accounts"`
}

Doc - All genesis values

type FullDoc

type FullDoc struct {
	ChainID                 string            `json:"chain_id"`
	AppOptions              *Doc              `json:"app_options"`
	Validators              []json.RawMessage `json:"validators"`
	MaxVals                 uint16            `json:"max_vals"`
	ReserveRequirementRatio string            `json:"reserve_requirement_ratio"`
	EnableHybridElection    bool              `json:"enable_hybrid_election"`
	TicketPrice             uint64            `json:"ticket_price"`
}

FullDoc - includes tendermint (in the json, we ignore here)

type InitStater

type InitStater interface {
	InitState(module, key, value string) error
}

InitStater is anything that can handle app options from genesis file. Setting the merkle store, config options, or anything else

type Option

type Option struct {
	Module string
	Key    string
	Value  string
}

Option just holds module/key/value triples from parsing the genesis file

func GetOptions

func GetOptions(path string) ([]Option, error)

GetOptions parses the genesis file in a format that can easily be handed into InitStaters

Jump to

Keyboard shortcuts

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