commands

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2025 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GenNodeKeyCmd = &cobra.Command{
	Use:   "gen-node-key",
	Short: "Generate a node key for this node and print its ID",
	RunE:  genNodeKey,
}

GenNodeKeyCmd allows the generation of a node key. It prints node's ID to the standard output.

View Source
var GenValidatorCmd = &cobra.Command{
	Use:   "gen-validator",
	Short: "Generate new validator keypair",
	RunE:  genValidator,
}

GenValidatorCmd allows the generation of a keypair for a validator.

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

InitFilesCmd initializes a fresh PellDVS instance.

View Source
var RootCmd = &cobra.Command{
	Use:   "pelldvs",
	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(cmd)
		if err != nil {
			return err
		}

		if config.LogFormat == cfg.LogFormatJSON {
			logger = log.NewLogger(os.Stdout, log.OutputJSONOption())
		}

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

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

RootCmd is the defaultRoot command for PellDVS core.

View Source
var ShowNodeIDCmd = &cobra.Command{
	Use:     "show-node-id",
	Aliases: []string{"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",
	Aliases: []string{"show_validator"},
	Short:   "Show this node's validator info",
	RunE:    showValidator,
}

ShowValidatorCmd adds capabilities for showing the validator info.

View Source
var StartAggregatorCmd = &cobra.Command{
	Use:   "start-aggregator",
	Short: "Start the aggregator",
	RunE:  startAggregator,
}

StartAggregatorCmd defines the command to start the aggregator

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

		if verbose {
			values, _ := json.MarshalIndent(struct {
				PellDVS       string `json:"pelldvs"`
				AVSI          string `json:"avsi"`
				BlockProtocol uint64 `json:"block_protocol"`
				P2PProtocol   uint64 `json:"p2p_protocol"`
			}{
				PellDVS:       cmtVersion,
				AVSI:          version.AVSIVersion,
				BlockProtocol: version.BlockProtocol,
				P2PProtocol:   version.P2PProtocol,
			}, "", "  ")
			fmt.Println(string(values))
		} else {
			fmt.Println(cmtVersion)
		}
	},
}

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 PellDVS node

func KeysCmd

func KeysCmd(p utils.Prompter) *cobra.Command

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 AVSI application.

func ParseConfig

func ParseConfig(cmd *cobra.Command) (*cfg.Config, error)

ParseConfig retrieves the default environment configuration, sets up the PellDVS defaultRoot and ensures that the defaultRoot exists

Types

This section is empty.

Directories

Path Synopsis
chains
dvs

Jump to

Keyboard shortcuts

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