2019-06-25 11:42:17 +00:00
|
|
|
package daemon
|
|
|
|
|
|
|
|
import (
|
2019-07-02 12:40:25 +00:00
|
|
|
"context"
|
2019-06-29 09:19:06 +00:00
|
|
|
|
2019-06-25 11:42:17 +00:00
|
|
|
"gopkg.in/urfave/cli.v2"
|
2019-06-29 09:19:06 +00:00
|
|
|
|
|
|
|
"github.com/filecoin-project/go-lotus/node"
|
2019-06-25 11:42:17 +00:00
|
|
|
)
|
|
|
|
|
2019-07-02 13:05:43 +00:00
|
|
|
// Cmd is the `go-lotus daemon` command
|
2019-06-25 11:42:17 +00:00
|
|
|
var Cmd = &cli.Command{
|
2019-06-28 09:03:28 +00:00
|
|
|
Name: "daemon",
|
2019-06-25 11:42:17 +00:00
|
|
|
Usage: "Start a lotus daemon process",
|
2019-07-02 12:40:25 +00:00
|
|
|
Action: func(cctx *cli.Context) error {
|
|
|
|
ctx := context.Background()
|
2019-06-29 09:19:06 +00:00
|
|
|
|
|
|
|
api, err := node.New(ctx)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return serveRPC(api)
|
2019-06-25 11:42:17 +00:00
|
|
|
},
|
|
|
|
}
|