commands

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2022 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GenGenesisCmd = &cobra.Command{
	Use:   "gen_genesis [number of validators]",
	Short: "Generate a new genesis file and specified number of validators, one of which is the top validator with power 100 while the rest has power 50",
	Args:  cobra.ExactArgs(1),
	RunE:  genGenesis,
}
View Source
var GenNodeKeyCmd = &cobra.Command{
	Use:     "gen-node-key",
	Aliases: []string{"gen_node_key"},
	Short:   "Generate a new node key",
	RunE:    genNodeKey,
	PreRun:  deprecateSnakeCase,
}

GenNodeKeyCmd allows the generation of a node key. It prints JSON-encoded NodeKey to the standard output.

View Source
var GenValidatorCmd = &cobra.Command{
	Use:     "gen-validator",
	Aliases: []string{"gen_validator"},
	Short:   "Generate new validator keypair",
	RunE:    genValidator,
	PreRun:  deprecateSnakeCase,
}

GenValidatorCmd allows the generation of a keypair for a validator.

View Source
var InitFilesCmd = &cobra.Command{
	Use:   "init",
	Short: "Initialize Tendermint",
	RunE:  initFiles,
}

InitFilesCmd initializes a fresh Tendermint Core instance.

View Source
var LightCmd = &cobra.Command{
	Use:   "light [chainID]",
	Short: "Run a light client proxy server, verifying Tendermint rpc",
	Long: `Run a light client proxy server, verifying Tendermint rpc.

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 than
that, it will present the same interface as a full Tendermint node.

Furthermore to the chainID, a fresh instance of a light client will
need a primary RPC address, a trusted hash and height and witness RPC addresses
(if not using sequential verification). To restart the node, thereafter
only the chainID is required.

When /abci_query is called, the Merkle key path format is:

	/{store name}/{key}

Please verify with your application that this Merkle key format is used (true
for applications built w/ Cosmos SDK).
`,
	RunE: runProxy,
	Args: cobra.ExactArgs(1),
	Example: `light cosmoshub-3 -p http://52.57.29.196:26657 -w http://public-seed-node.cosmoshub.certus.one:26657
	--height 962118 --hash 28B97BE9F6DE51AC69F70E0B7BFD7E5C9CD1A595B7DC31AFF27C50D4948020CD`,
}

LightCmd represents the base command when called without any subcommands

View Source
var ProbeUpnpCmd = &cobra.Command{
	Use:     "probe-upnp",
	Aliases: []string{"probe_upnp"},
	Short:   "Test UPnP functionality",
	RunE:    probeUpnp,
	PreRun:  deprecateSnakeCase,
}

ProbeUpnpCmd adds capabilities to test the UPnP functionality.

View Source
var ReplayCmd = &cobra.Command{
	Use:   "replay",
	Short: "Replay messages from WAL",
	Run: func(cmd *cobra.Command, args []string) {
		consensus.RunReplayFile(config.BaseConfig, config.Consensus, false)
	},
}

ReplayCmd allows replaying of messages from the WAL.

View Source
var ReplayConsoleCmd = &cobra.Command{
	Use:     "replay-console",
	Aliases: []string{"replay_console"},
	Short:   "Replay messages from WAL in a console",
	Run: func(cmd *cobra.Command, args []string) {
		consensus.RunReplayFile(config.BaseConfig, config.Consensus, true)
	},
	PreRun: deprecateSnakeCase,
}

ReplayConsoleCmd allows replaying of messages from the WAL in a console.

View Source
var ResetAllCmd = &cobra.Command{
	Use:     "unsafe-reset-all",
	Aliases: []string{"unsafe_reset_all"},
	Short:   "(unsafe) Remove all the data and WAL, reset this node's validator to genesis state",
	RunE:    resetAll,
	PreRun:  deprecateSnakeCase,
}

ResetAllCmd removes the database of this Tendermint core instance.

View Source
var ResetPrivValidatorCmd = &cobra.Command{
	Use:     "unsafe-reset-priv-validator",
	Aliases: []string{"unsafe_reset_priv_validator"},
	Short:   "(unsafe) Reset this node's validator to genesis state",
	RunE:    resetPrivValidator,
	PreRun:  deprecateSnakeCase,
}

ResetPrivValidatorCmd resets the private validator files.

View Source
var RootCmd = &cobra.Command{
	Use:   "tendermint",
	Short: "BFT state machine replication for applications in any programming languages",
	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 config.LogFormat == cfg.LogFormatJSON {
			logger = log.NewTMJSONLogger(log.NewSyncWriter(os.Stdout))
		}

		logger, err = tmflags.ParseLogLevel(config.LogLevel, logger, cfg.DefaultLogLevel)
		if err != nil {
			return err
		}

		if viper.GetBool(cli.TraceFlag) {
			logger = log.NewTracingLogger(logger)
		}

		logger = logger.With("module", "main")
		return nil
	},
}

RootCmd is the root command for Tendermint core.

View Source
var ShowNodeIDCmd = &cobra.Command{
	Use:     "show-node-id",
	Aliases: []string{"show_node_id"},
	Short:   "Show this node's ID",
	RunE:    showNodeID,
	PreRun:  deprecateSnakeCase,
}

ShowNodeIDCmd dumps node's ID to the standard output.

View Source
var ShowValidatorCmd = &cobra.Command{
	Use:     "show-validator",
	Aliases: []string{"show_validator"},
	Short:   "Show this node's validator info",
	RunE:    showValidator,
	PreRun:  deprecateSnakeCase,
}

ShowValidatorCmd adds capabilities for showing the validator info.

View Source
var TestnetFilesCmd = &cobra.Command{
	Use:   "testnet",
	Short: "Initialize files for a Tendermint testnet",
	Long: `testnet will create "v" + "n" number of directories and populate each with
necessary files (private validator, genesis, config, etc.).

Note, strict routability for addresses is turned off in the config file.

Optionally, it will fill in persistent-peers list in config file using either hostnames or IPs.

Example:

	tendermint testnet --v 4 --o ./output --populate-persistent-peers --starting-ip-address 192.168.10.2
	`,
	RunE: testnetFiles,
}

TestnetFilesCmd allows initialisation of files for a Tendermint testnet.

View Source
var VersionCmd = &cobra.Command{
	Use:   "version",
	Short: "Show version info",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println(version.TMCoreSemVer)
	},
}

VersionCmd ...

Functions

func AddNodeFlags

func AddNodeFlags(cmd *cobra.Command)

AddNodeFlags exposes some common configuration options on the command-line These are exposed for convenience of commands embedding a tendermint node

func NewRunNodeCmd

func NewRunNodeCmd(nodeProvider nm.Provider) *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 ParseConfig

func ParseConfig() (*cfg.Config, error)

ParseConfig retrieves the default environment configuration, sets up the Tendermint root and ensures that the root exists

func ResetAll

func ResetAll(dbDir, addrBookFile, privValKeyFile, privValStateFile string, logger log.Logger) error

ResetAll removes address book files plus all data, and resets the privValdiator data. Exported so other CLI tools can use it.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL