You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
523 B

package main
import (
"fmt"
"os"
"github.com/tendermint/tendermint/config"
"github.com/tendermint/tendermint/state"
)
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)
}