Documentation
¶
Index ¶
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 BlockChain",
RunE: initFiles,
}
InitFilesCmd initialises a fresh BlockChain Core instance.
var ReplayCmd = &cobra.Command{ Use: "replay", Short: "Replay messages from WAL", Run: func(cmd *cobra.Command, args []string) { consensus.RunReplayFile(config, false) }, }
ReplayCmd allows replaying of messages from the WAL.
var ReplayConsoleCmd = &cobra.Command{ Use: "replay_console", Short: "Replay messages from WAL in a console", Run: func(cmd *cobra.Command, args []string) { consensus.RunReplayFile(config, true) }, }
ReplayConsoleCmd allows replaying of messages from the WAL in a console.
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 core instance.
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.
var RootCmd = &cobra.Command{ Use: "linkchain", Short: "linkchain root command", PersistentPreRunE: func(cmd *cobra.Command, args []string) (err error) { if cmd.Name() == VersionCmd.Name() { return nil } if cmd.Name() == NewConsoleCommand().Name() { return nil } config, err = ParseConfig() if err != nil { return err } if !filepath.IsAbs(config.Log.Filename) { config.Log.Filename = filepath.Join(config.LogDir(), config.Log.Filename) } logDir := filepath.Dir(config.Log.Filename) if err := os.MkdirAll(logDir, 0755); err != nil { return err } logOnce.Do(func() { rotateHandler, err := log.RotateHandler(config.Log, log.TerminalFormat(false)) if err != nil { logger.Error("rotateHandler err", "err", err) return } logger.SetHandler(rotateHandler) }) logger, err = log.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.
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 VersionCmd = &cobra.Command{ Use: "version", Short: "Show version info", Run: func(cmd *cobra.Command, args []string) { fmt.Printf("linkchain version: %s, gitCommit:%s ,gitBranch:%s\n", version.Version, version.GitCommit, version.GitBranch) }, }
VersionCmd ...
Functions ¶
func AddNodeFlags ¶
AddNodeFlags exposes some common configuration options on the command-line These are exposed for convenience of commands embedding a node
func NewConsoleCommand ¶
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 ParseConfig ¶
ParseConfig retrieves the default environment configuration, sets up the root and ensures that the root exists
Types ¶
type ContractData ¶
type ContractData struct {
// contains filtered or unexported fields
}
ContractData used to store the contract data that we need repaly