github.com/Oyster-zx/tendermint@v0.34.24-fork/cmd/tendermint/main.go (about) 1 package main 2 3 import ( 4 "os" 5 "path/filepath" 6 7 cmd "github.com/tendermint/tendermint/cmd/tendermint/commands" 8 "github.com/tendermint/tendermint/cmd/tendermint/commands/debug" 9 cfg "github.com/tendermint/tendermint/config" 10 "github.com/tendermint/tendermint/libs/cli" 11 nm "github.com/tendermint/tendermint/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 }