Documentation
¶
Index ¶
- Variables
- func DaemonContext(cctx *cli.Context) context.Context
- func GetAPIInfo(ctx *cli.Context) (config.APIInfo, error)
- func GetFullNodeAPI(ctx *cli.Context, fn *config.APIInfo, version string) (v1.FullNode, jsonrpc.ClientCloser, error)
- func GetMinerAPI(ctx *cli.Context) (api.MinerAPI, jsonrpc.ClientCloser, error)
- func GetRawAPI(ctx *cli.Context, version string) (string, http.Header, error)
- func ReqContext(cctx *cli.Context) context.Context
- func RunApp(app *ufcli.App)
- type PrintHelpErr
Constants ¶
This section is empty.
Variables ¶
View Source
var CommonCommands = []*cli.Command{ logCmd, VersionCmd, }
View Source
var VersionCmd = &cli.Command{ Name: "version", Usage: "Print version", Action: func(cctx *cli.Context) error { api, closer, err := GetMinerAPI(cctx) if err != nil { return err } defer closer() ctx := ReqContext(cctx) v, err := api.Version(ctx) if err != nil { return err } fmt.Println("Daemon: ", v) fmt.Print("Local: ") cli.VersionPrinter(cctx) return nil }, }
Functions ¶
func DaemonContext ¶
func GetAPIInfo ¶
func GetFullNodeAPI ¶
func GetMinerAPI ¶
func ReqContext ¶
ReqContext returns context for cli execution. Calling it for the first time installs SIGTERM handler that will close returned context. Not safe for concurrent execution.
Types ¶
type PrintHelpErr ¶
func (*PrintHelpErr) Error ¶
func (e *PrintHelpErr) Error() string
func (*PrintHelpErr) Is ¶
func (e *PrintHelpErr) Is(o error) bool
func (*PrintHelpErr) Unwrap ¶
func (e *PrintHelpErr) Unwrap() error
Click to show internal directories.
Click to hide internal directories.