2017-03-13 17:20:07 -07:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
2017-03-08 23:19:07 -08:00
|
|
|
"github.com/spf13/cobra"
|
2017-03-13 17:20:07 -07:00
|
|
|
|
2017-06-26 05:18:36 -07:00
|
|
|
tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands"
|
2017-03-13 17:20:07 -07:00
|
|
|
)
|
|
|
|
|
2017-07-05 03:57:52 -07:00
|
|
|
// UnsafeResetAllCmd - extension of the tendermint command, resets initialization
|
2017-03-08 23:19:07 -08:00
|
|
|
var UnsafeResetAllCmd = &cobra.Command{
|
|
|
|
Use: "unsafe_reset_all",
|
|
|
|
Short: "Reset all blockchain data",
|
2017-04-15 09:07:27 -07:00
|
|
|
RunE: unsafeResetAllCmd,
|
2017-03-13 17:20:07 -07:00
|
|
|
}
|
|
|
|
|
2017-04-15 09:07:27 -07:00
|
|
|
func unsafeResetAllCmd(cmd *cobra.Command, args []string) error {
|
2017-06-26 05:18:36 -07:00
|
|
|
cfg, err := tcmd.ParseConfig()
|
2017-05-22 04:30:42 -07:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2017-06-26 05:18:36 -07:00
|
|
|
tcmd.ResetAll(cfg.DBDir(), cfg.PrivValidatorFile(), logger)
|
2017-04-15 09:07:27 -07:00
|
|
|
return nil
|
2017-03-13 17:20:07 -07:00
|
|
|
}
|