Refactoring genesis, including PubKey into TxInput

This commit is contained in:
Jae Kwon
2014-12-28 00:44:56 -08:00
parent 70eb75dca7
commit f91665fe07
17 changed files with 308 additions and 178 deletions

View File

@@ -2,7 +2,6 @@ package main
import (
"fmt"
"os"
"github.com/tendermint/tendermint/config"
"github.com/tendermint/tendermint/state"
@@ -10,14 +9,15 @@ import (
func gen_validator() {
// If already exists, bail out.
filename := config.PrivValidatorFile()
if _, err := os.Stat(filename); !os.IsNotExist(err) {
fmt.Printf("Cannot generate new validator, file already exists at %v\n", filename)
}
// Generate private validator
privValidator := state.GenPrivValidator()
privValidator.Save()
fmt.Printf("Generated a new validator at %v\n", filename)
privValidatorJSONBytes := privValidator.JSONBytes()
fmt.Printf(`Generated a new validator!
Paste the following JSON into your %v file
%v
`,
config.PrivValidatorFile(),
string(privValidatorJSONBytes),
)
}