2020-06-02 19:31:21 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
_ "net/http/pprof"
|
|
|
|
|
2020-06-04 22:33:43 +00:00
|
|
|
"github.com/urfave/cli/v2"
|
2020-06-02 19:31:21 +00:00
|
|
|
|
|
|
|
lcli "github.com/filecoin-project/lotus/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
var stopCmd = &cli.Command{
|
|
|
|
Name: "stop",
|
2020-07-11 08:55:13 +00:00
|
|
|
Usage: "Stop a running lotus miner",
|
2020-06-02 19:31:21 +00:00
|
|
|
Flags: []cli.Flag{},
|
|
|
|
Action: func(cctx *cli.Context) error {
|
|
|
|
api, closer, err := lcli.GetAPI(cctx)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
defer closer()
|
|
|
|
|
|
|
|
err = api.Shutdown(lcli.ReqContext(cctx))
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
},
|
|
|
|
}
|