commands

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2020 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBCDir = "chainroot"
)

Variables

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

ResetAllCmd removes the database of this Tendermint core instance.

View Source
var ResetPrivValidatorCmd = &cobra.Command{
	Use:   "unsafe_reset_priv_validator",
	Short: "(unsafe) Reset this node's validator to genesis state",
	Run:   resetPrivValidator,
}

ResetPrivValidatorCmd resets the private validator files.

View Source
var RootCmd = &cobra.Command{
	Use:   "bcb",
	Short: "Rhizome-Chain on Tendermint Core (BFT Consensus)",
	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",
	Short: "Show this node's ID",
	RunE:  showNodeID,
}

ShowNodeIDCmd dumps node's ID to the standard output.

View Source
var ShowValidatorCmd = &cobra.Command{
	Use:   "show_validator",
	Short: "Show this node's validator info",
	RunE:  showValidator,
}

ShowValidatorCmd adds capabilities for showing the validator info.

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

VersionCmd ...

Functions

func AddFlags added in v0.0.2

func AddFlags(cmd *cobra.Command)

func AddInitCommand added in v0.0.2

func AddInitCommand(cmd *cobra.Command, daemonProvider *daemon.BaseProvider)

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 AddStartCommand

func AddStartCommand(cmd *cobra.Command, daemonProvider *daemon.BaseProvider)

func DoCmd

func DoCmd(daemonProvider *daemon.BaseProvider)

func EnsureRoot added in v0.0.2

func EnsureRoot(rootDir string)

func InitRootCommand

func InitRootCommand() *cobra.Command

func NewInitCmd

func NewInitCmd(daemonProvider *daemon.BaseProvider) *cobra.Command

func NewStartCmd

func NewStartCmd(nodeProvider tm.Provider, daemonProvider *daemon.BaseProvider) *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)

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.

Jump to

Keyboard shortcuts

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