Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var StartCmd = &cobra.Command{ Use: "start", Aliases: []string{"node", "run"}, Short: "Run the DOID node", RunE: func(cmd *cobra.Command, args []string) error { n, err := node.NewNode(logger) if err != nil { return fmt.Errorf("failed to create node: %w", err) } if err := n.Start(); err != nil { return fmt.Errorf("failed to start node: %w", err) } logger.Info("started node") os.TrapSignal(logger, func() { if n.IsRunning() { if err := n.Stop(); err != nil { logger.Error("unable to stop the node", "error", err) } } }) select {} }, }
StartCmd is the command that allows the CLI to start a node.
View Source
var VersionCmd = &cobra.Command{ Use: "version", Short: "Show version info", Run: func(cmd *cobra.Command, args []string) { fmt.Println("Version:", version.VersionWithMeta) if version.Commit != "" { fmt.Println("Git Commit:", version.Commit) } if version.Date != "" { fmt.Println("Git Commit Date:", version.Date) } fmt.Println("Architecture:", runtime.GOARCH) fmt.Println("Go Version:", runtime.Version()) fmt.Println("Operating System:", runtime.GOOS) fmt.Printf("GOPATH=%s\n", os.Getenv("GOPATH")) fmt.Printf("GOROOT=%s\n", runtime.GOROOT()) }, }
VersionCmd ...
Functions ¶
func RootCmdExecutor ¶
func RootCmdExecutor() cli.Executable
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.