mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-03 22:57:22 +00:00
tendermint init
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
func init_files() {
|
||||
privValidator := types.GenPrivValidator()
|
||||
privValidator.SetFile(config.GetString("priv_validator_file"))
|
||||
privValidator.Save()
|
||||
|
||||
//TODO: chainID
|
||||
genDoc := types.GenesisDoc{
|
||||
ChainID: "hi",
|
||||
}
|
||||
genDoc.Validators = []types.GenesisValidator{types.GenesisValidator{
|
||||
PubKey: privValidator.PubKey,
|
||||
Amount: 10000,
|
||||
}}
|
||||
|
||||
genDoc.SaveAs(config.GetString("genesis_file"))
|
||||
|
||||
}
|
||||
@@ -34,6 +34,8 @@ Commands:
|
||||
switch args[0] {
|
||||
case "node":
|
||||
node.RunNode()
|
||||
case "init":
|
||||
init_files()
|
||||
case "show_validator":
|
||||
show_validator()
|
||||
case "gen_validator":
|
||||
|
||||
Reference in New Issue
Block a user