{"modulePath":"github.com/DOIDFoundation/node","version":"v0.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package commands\n\n## Variables\n\n```go\nvar StartCmd = \u0026cobra.Command{\n\tUse:     \"start\",\n\tAliases: []string{\"node\", \"run\"},\n\tShort:   \"Run the DOID node\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tn, err := node.NewNode(logger)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create node: %w\", err)\n\t\t}\n\n\t\tif err := n.Start(); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to start node: %w\", err)\n\t\t}\n\n\t\tlogger.Info(\"started node\")\n\n\t\tos.TrapSignal(logger, func() {\n\t\t\tif n.IsRunning() {\n\t\t\t\tif err := n.Stop(); err != nil {\n\t\t\t\t\tlogger.Error(\"unable to stop the node\", \"error\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tselect {}\n\t},\n}\n```\nStartCmd is the command that allows the CLI to start a node.\n\n```go\nvar VersionCmd = \u0026cobra.Command{\n\tUse:   \"version\",\n\tShort: \"Show version info\",\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tfmt.Println(\"Version:\", version.VersionWithMeta)\n\t\tif version.Commit != \"\" {\n\t\t\tfmt.Println(\"Git Commit:\", version.Commit)\n\t\t}\n\t\tif version.Date != \"\" {\n\t\t\tfmt.Println(\"Git Commit Date:\", version.Date)\n\t\t}\n\t\tfmt.Println(\"Architecture:\", runtime.GOARCH)\n\t\tfmt.Println(\"Go Version:\", runtime.Version())\n\t\tfmt.Println(\"Operating System:\", runtime.GOOS)\n\t\tfmt.Printf(\"GOPATH=%s\\n\", os.Getenv(\"GOPATH\"))\n\t\tfmt.Printf(\"GOROOT=%s\\n\", runtime.GOROOT())\n\t},\n}\n```\nVersionCmd ...\n\n## Functions\n\n```go\nfunc RootCmdExecutor() cli.Executable\n```\n\n","path":"github.com/DOIDFoundation/node/cmd/doidnode/commands","name":"commands","synopsis":"","isRedistributable":true}
