Documentation
¶
Index ¶
- Variables
- func BuildFromMap(m map[string][]byte, gen *Genesis) error
- func CreateTestGenesisJSONFile(asRaw bool) (string, error)
- func NewGenesisBlockFromTrie(t *trie.Trie) (*types.Header, error)
- func NewLegacyRuntimeFromGenesis(g *Genesis, storage runtime.Storage) (runtime.LegacyInstance, error)
- func NewTrieFromGenesis(g *Genesis) (*trie.Trie, error)
- type Data
- type Fields
- type Genesis
Constants ¶
This section is empty.
Variables ¶
var TestFieldsHR = Fields{ Raw: [2]map[string]string{}, Runtime: map[string]map[string]interface{}{ "system": { "code": "mocktestcode", }, }, }
TestFieldsHR instance of human-readable Fields struct for testing, use with TestGenesis
var TestFieldsRaw = Fields{ Raw: [2]map[string]string{ 0: {"0x3a636f6465": "mocktestcode"}, }, }
TestFieldsRaw instance of raw Fields struct for testing use with TestGenesis
var TestGenesis = &Genesis{
Name: "gossamer",
ID: "gossamer",
Bootnodes: testBootnodes,
ProtocolID: testProtocolID,
}
TestGenesis instance of Genesis struct for testing
Functions ¶
func BuildFromMap ¶ added in v0.2.0
BuildFromMap builds genesis fields data from map
func CreateTestGenesisJSONFile ¶ added in v0.2.0
CreateTestGenesisJSONFile utility to create mock test genesis JSON file
func NewGenesisBlockFromTrie ¶
NewGenesisBlockFromTrie creates a genesis block from the provided trie
func NewLegacyRuntimeFromGenesis ¶ added in v0.2.0
func NewLegacyRuntimeFromGenesis(g *Genesis, storage runtime.Storage) (runtime.LegacyInstance, error)
NewLegacyRuntimeFromGenesis creates a runtime instance from the genesis data
Types ¶
type Fields ¶
type Fields struct {
Raw [2]map[string]string `json:"raw"`
Runtime map[string]map[string]interface{} `json:"runtime,omitempty"`
}
Fields stores genesis raw data, and human readable runtime data
type Genesis ¶
type Genesis struct {
Name string `json:"name"`
ID string `json:"id"`
Bootnodes []string `json:"bootNodes"`
ProtocolID string `json:"protocolId"`
Genesis Fields `json:"genesis"`
}
Genesis stores the data parsed from the genesis configuration file
func NewGenesisFromJSON ¶
NewGenesisFromJSON parses Human Readable JSON formatted genesis file.Name. If authCount > 0, then it keeps only `authCount` number of authorities for babe and grandpa.
func NewGenesisFromJSONRaw ¶ added in v0.2.0
NewGenesisFromJSONRaw parses a JSON formatted genesis-raw file
func (*Genesis) GenesisData ¶
GenesisData formats genesis for trie storage
func (*Genesis) GenesisFields ¶
GenesisFields returns the genesis fields including genesis raw data