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.

31 lines
1.0 KiB

  1. package commands
  2. import (
  3. "github.com/spf13/cobra"
  4. "github.com/tendermint/tendermint/config"
  5. "github.com/tendermint/tendermint/internal/consensus"
  6. "github.com/tendermint/tendermint/libs/log"
  7. )
  8. // MakeReplayCommand constructs a command to replay messages from the WAL into consensus.
  9. func MakeReplayCommand(conf *config.Config, logger log.Logger) *cobra.Command {
  10. return &cobra.Command{
  11. Use: "replay",
  12. Short: "Replay messages from WAL",
  13. RunE: func(cmd *cobra.Command, args []string) error {
  14. return consensus.RunReplayFile(cmd.Context(), logger, conf.BaseConfig, conf.Consensus, false)
  15. },
  16. }
  17. }
  18. // MakeReplayConsoleCommand constructs a command to replay WAL messages to stdout.
  19. func MakeReplayConsoleCommand(conf *config.Config, logger log.Logger) *cobra.Command {
  20. return &cobra.Command{
  21. Use: "replay-console",
  22. Short: "Replay messages from WAL in a console",
  23. RunE: func(cmd *cobra.Command, args []string) error {
  24. return consensus.RunReplayFile(cmd.Context(), logger, conf.BaseConfig, conf.Consensus, true)
  25. },
  26. }
  27. }