github.com/ari-anchor/sei-tendermint@v0.0.0-20230519144642-dc826b7b56bb/cmd/tendermint/commands/replay.go (about)

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