cosmos-sdk/cmd/commands/reset.go

26 lines
541 B
Go
Raw Normal View History

2017-03-13 17:20:07 -07:00
package commands
import (
"path"
"github.com/spf13/cobra"
2017-03-13 17:20:07 -07:00
2017-04-15 09:07:27 -07:00
tmcmd "github.com/tendermint/tendermint/cmd/tendermint/commands"
2017-03-13 17:20:07 -07:00
tmcfg "github.com/tendermint/tendermint/config/tendermint"
)
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-03-13 17:20:07 -07:00
basecoinDir := BasecoinRoot("")
2017-03-14 00:11:49 -07:00
tmDir := path.Join(basecoinDir)
2017-03-13 17:20:07 -07:00
tmConfig := tmcfg.GetConfig(tmDir)
2017-04-15 09:07:27 -07:00
tmcmd.ResetAll(tmConfig, log)
return nil
2017-03-13 17:20:07 -07:00
}