fewer structs. remove viper from consensus

This commit is contained in:
Ethan Buchman
2017-05-01 20:09:29 -04:00
parent d8fb226ec4
commit 75b6c5215f
17 changed files with 371 additions and 299 deletions

View File

@ -1,36 +1,26 @@
package commands
import (
"fmt"
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/consensus"
"github.com/spf13/cobra"
)
var replayCmd = &cobra.Command{
Use: "replay [walfile]",
Use: "replay",
Short: "Replay messages from WAL",
Run: func(cmd *cobra.Command, args []string) {
if len(args) > 1 {
consensus.RunReplayFile(config, args[1], false)
} else {
fmt.Println("replay requires an argument (walfile)")
}
config := getConfig()
consensus.RunReplayFile(config.Config, config.Consensus, false)
},
}
var replayConsoleCmd = &cobra.Command{
Use: "replay_console [walfile]",
Use: "replay_console",
Short: "Replay messages from WAL in a console",
Run: func(cmd *cobra.Command, args []string) {
if len(args) > 1 {
consensus.RunReplayFile(config, args[1], true)
} else {
fmt.Println("replay_console requires an argument (walfile)")
}
config := getConfig()
consensus.RunReplayFile(config.Config, config.Consensus, true)
},
}