github.com/vipernet-xyz/tm@v0.34.24/cmd/tendermint/main.go (about)

     1  package main
     2  
     3  import (
     4  	"os"
     5  	"path/filepath"
     6  
     7  	cmd "github.com/vipernet-xyz/tm/cmd/tendermint/commands"
     8  	"github.com/vipernet-xyz/tm/cmd/tendermint/commands/debug"
     9  	cfg "github.com/vipernet-xyz/tm/config"
    10  	"github.com/vipernet-xyz/tm/libs/cli"
    11  	nm "github.com/vipernet-xyz/tm/node"
    12  )
    13  
    14  func main() {
    15  	rootCmd := cmd.RootCmd
    16  	rootCmd.AddCommand(
    17  		cmd.GenValidatorCmd,
    18  		cmd.InitFilesCmd,
    19  		cmd.ProbeUpnpCmd,
    20  		cmd.LightCmd,
    21  		cmd.ReIndexEventCmd,
    22  		cmd.ReplayCmd,
    23  		cmd.ReplayConsoleCmd,
    24  		cmd.ResetAllCmd,
    25  		cmd.ResetPrivValidatorCmd,
    26  		cmd.ResetStateCmd,
    27  		cmd.ShowValidatorCmd,
    28  		cmd.TestnetFilesCmd,
    29  		cmd.ShowNodeIDCmd,
    30  		cmd.GenNodeKeyCmd,
    31  		cmd.VersionCmd,
    32  		cmd.RollbackStateCmd,
    33  		cmd.CompactGoLevelDBCmd,
    34  		debug.DebugCmd,
    35  		cli.NewCompletionCmd(rootCmd, true),
    36  	)
    37  
    38  	// NOTE:
    39  	// Users wishing to:
    40  	//	* Use an external signer for their validators
    41  	//	* Supply an in-proc abci app
    42  	//	* Supply a genesis doc file from another source
    43  	//	* Provide their own DB implementation
    44  	// can copy this file and use something other than the
    45  	// DefaultNewNode function
    46  	nodeFunc := nm.DefaultNewNode
    47  
    48  	// Create & start node
    49  	rootCmd.AddCommand(cmd.NewRunNodeCmd(nodeFunc))
    50  
    51  	cmd := cli.PrepareBaseCmd(rootCmd, "TM", os.ExpandEnv(filepath.Join("$HOME", cfg.DefaultTendermintDir)))
    52  	if err := cmd.Execute(); err != nil {
    53  		panic(err)
    54  	}
    55  }