Documentation ¶
Index ¶
- Variables
- func AddNodeFlags(cmd *cobra.Command)
- func NewRotateLogger(path string) tmlog.Logger
- func NewRunNodeCmd(nodeProvider nm.NodeProvider) *cobra.Command
- func NewTMFmtLogger(w io.Writer) kitlog.Logger
- func ParseConfig() (*cfg.Config, error)
- func ResetAll(dbDir, privValFile string, logger log.Logger)
- type BaseLogger
Constants ¶
This section is empty.
Variables ¶
var GenValidatorCmd = &cobra.Command{
Use: "gen_validator",
Short: "Generate new validator keypair",
Run: genValidator,
}
GenValidatorCmd allows the generation of a keypair for a validator.
var InitFilesCmd = &cobra.Command{
Use: "init",
Short: "Initialize Tendermint",
Run: initFiles,
}
InitFilesCmd initialises a fresh Tendermint Core instance.
var LiteCmd = &cobra.Command{ Use: "lite", Short: "Run lite-client proxy server, verifying tendermint rpc", Long: `This node will run a secure proxy to a tendermint rpc server. All calls that can be tracked back to a block header by a proof will be verified before passing them back to the caller. Other that that it will present the same interface as a full tendermint node, just with added trust and running locally.`, RunE: runProxy, SilenceUsage: true, }
LiteCmd represents the base command when called without any subcommands
var ProbeUpnpCmd = &cobra.Command{
Use: "probe_upnp",
Short: "Test UPnP functionality",
RunE: probeUpnp,
}
ProbeUpnpCmd adds capabilities to test the UPnP functionality.
var ResetAllCmd = &cobra.Command{
Use: "unsafe_reset_all",
Short: "(unsafe) Remove all the data and WAL, reset this node's validator",
Run: resetAll,
}
ResetAllCmd removes the database of this Tendermint core instance.
var ResetPrivValidatorCmd = &cobra.Command{
Use: "unsafe_reset_priv_validator",
Short: "(unsafe) Reset this node's validator",
Run: resetPrivValidator,
}
ResetPrivValidatorCmd resets the private validator files.
var RollbackCmd = &cobra.Command{
Use: "rollback",
Short: "tendermint rollback to the height",
Run: rollback,
}
RollbackCmd rollback tendermint to the height
var RootCmd = &cobra.Command{ Use: "tendermint", Short: "Tendermint Core (BFT Consensus) in Go", PersistentPreRunE: func(cmd *cobra.Command, args []string) (err error) { if cmd.Name() == VersionCmd.Name() { return nil } config, err = ParseConfig() if err != nil { return err } if len(config.Logfile) > 0 { logger = NewRotateLogger(config.Logfile) } logger, err = tmflags.ParseLogLevel(config.LogLevel, logger, cfg.DefaultLogLevel()) if err != nil { return err } if viper.GetBool(cli.TraceFlag) { logger = log.NewTracingLogger(logger) } return nil }, }
RootCmd is the root command for Tendermint core.
var ShowValidatorCmd = &cobra.Command{
Use: "show_validator",
Short: "Show this node's validator info",
Run: showValidator,
}
ShowValidatorCmd adds capabilities for showing the validator info.
var TestnetFilesCmd = &cobra.Command{
Use: "testnet",
Short: "Initialize files for a Tendermint testnet",
Run: testnetFiles,
}
TestnetFilesCmd allows initialisation of files for a Tendermint testnet.
var VersionCmd = &cobra.Command{ Use: "version", Short: "Show version info", Run: func(cmd *cobra.Command, args []string) { fmt.Println(version.Version) }, }
VersionCmd ...
Functions ¶
func AddNodeFlags ¶
AddNodeFlags exposes some common configuration options on the command-line These are exposed for convenience of commands embedding a tendermint node
func NewRotateLogger ¶
NewRotateLogger returns a logger that encodes msg and keyvals to the Writer using go-kit's log as an underlying logger and our custom formatter. Note that underlying logger could be swapped with something else.
func NewRunNodeCmd ¶
func NewRunNodeCmd(nodeProvider nm.NodeProvider) *cobra.Command
NewRunNodeCmd returns the command that allows the CLI to start a node. It can be used with a custom PrivValidator and in-process ABCI application.
func NewTMFmtLogger ¶
NewTMFmtLogger returns a logger that encodes keyvals to the Writer in Tendermint custom format. Note complex types (structs, maps, slices) formatted as "%+v".
Each log event produces no more than one call to w.Write. The passed Writer must be safe for concurrent use by multiple goroutines if the returned Logger will be used concurrently.
func ParseConfig ¶
ParseConfig retrieves the default environment configuration, sets up the Tendermint root and ensures that the root exists