Skip to content
Snippets Groups Projects
Unverified Commit 1e71bd48 authored by Benjamin Bollen's avatar Benjamin Bollen
Browse files

genesis: add GenerateGenesisFileBytes()

parent 804cadcf
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,25 @@ func GenerateKnown(chainID, accountsPathCSV, validatorsPathCSV string) (string,
time.Now())
}
//------------------------------------------------------------------------------------
// interface functions that are consumed by monax tooling
func GenerateGenesisFileBytes(chainName string, genesisAccounts []*GenesisAccount,
genesisValidators []*GenesisValidator) ([]byte, error) {
genesisDoc, err := MakeGenesisDocFromAccounts(chainName, genesisAccounts, genesisValidators)
buf, buf2, n := new(bytes.Buffer), new(bytes.Buffer), new(int)
wire.WriteJSON(genesisDoc, buf, n, &err)
if err != nil {
return nil, err
}
if err := json.Indent(buf2, buf.Bytes(), "", "\t"); err != nil {
return nil, err
}
return buf2.Bytes(), nil
}
//------------------------------------------------------------------------------------
// core functions that provide functionality for monax tooling in v0.16
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment