-
Notifications
You must be signed in to change notification settings - Fork 14
/
tm_replay.go
37 lines (33 loc) · 1.09 KB
/
tm_replay.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package server
import (
"github.com/cosmos/cosmos-sdk/server"
"github.com/spf13/cobra"
cfg "github.com/tendermint/tendermint/config"
"github.com/tendermint/tendermint/consensus"
)
// ReplayCmd allows replaying of messages from the WAL.
func ReplayCmd() *cobra.Command {
return &cobra.Command{
Use: "replay",
Short: "Replay messages from WAL",
Run: func(cmd *cobra.Command, args []string) {
serverCtx := server.GetServerContextFromCmd(cmd)
cfg.EnsureRoot(serverCtx.Config.RootDir)
consensus.RunReplayFile(serverCtx.Config.BaseConfig, serverCtx.Config.Consensus, false)
},
}
}
// ReplayConsoleCmd allows replaying of messages from the WAL in a
// console.
func ReplayConsoleCmd() *cobra.Command {
return &cobra.Command{
Use: "replay-console",
Aliases: []string{"replay_console"},
Short: "Replay messages from WAL in a console",
Run: func(cmd *cobra.Command, args []string) {
serverCtx := server.GetServerContextFromCmd(cmd)
cfg.EnsureRoot(serverCtx.Config.RootDir)
consensus.RunReplayFile(serverCtx.Config.BaseConfig, serverCtx.Config.Consensus, true)
},
}
}