Merge pull request #5900 from filecoin-project/mg/chore/move-mpool-clear
chore: Move lotus mpool clear to lotus-shed
This commit is contained in:
commit
49f8b8df00
@ -132,9 +132,11 @@ var MpoolPending = &cli.Command{
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Deprecated: MpoolClear is now available at `lotus-shed mpool clear`
|
||||||
var MpoolClear = &cli.Command{
|
var MpoolClear = &cli.Command{
|
||||||
Name: "clear",
|
Name: "clear",
|
||||||
Usage: "Clear all pending messages from the mpool (USE WITH CARE)",
|
Usage: "Clear all pending messages from the mpool (USE WITH CARE) (DEPRECATED)",
|
||||||
|
Hidden: true,
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "local",
|
Name: "local",
|
||||||
@ -146,6 +148,7 @@ var MpoolClear = &cli.Command{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Action: func(cctx *cli.Context) error {
|
Action: func(cctx *cli.Context) error {
|
||||||
|
fmt.Println("DEPRECATED: This behavior is being moved to `lotus-shed mpool clear`")
|
||||||
api, closer, err := GetFullNodeAPI(cctx)
|
api, closer, err := GetFullNodeAPI(cctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -15,6 +15,7 @@ var mpoolCmd = &cli.Command{
|
|||||||
Flags: []cli.Flag{},
|
Flags: []cli.Flag{},
|
||||||
Subcommands: []*cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
minerSelectMsgsCmd,
|
minerSelectMsgsCmd,
|
||||||
|
mpoolClear,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,3 +67,36 @@ var minerSelectMsgsCmd = &cli.Command{
|
|||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var mpoolClear = &cli.Command{
|
||||||
|
Name: "clear",
|
||||||
|
Usage: "Clear all pending messages from the mpool (USE WITH CARE)",
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
&cli.BoolFlag{
|
||||||
|
Name: "local",
|
||||||
|
Usage: "also clear local messages",
|
||||||
|
},
|
||||||
|
&cli.BoolFlag{
|
||||||
|
Name: "really-do-it",
|
||||||
|
Usage: "must be specified for the action to take effect",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Action: func(cctx *cli.Context) error {
|
||||||
|
api, closer, err := lcli.GetFullNodeAPI(cctx)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer closer()
|
||||||
|
|
||||||
|
really := cctx.Bool("really-do-it")
|
||||||
|
if !really {
|
||||||
|
//nolint:golint
|
||||||
|
return fmt.Errorf("--really-do-it must be specified for this action to have an effect; you have been warned")
|
||||||
|
}
|
||||||
|
|
||||||
|
local := cctx.Bool("local")
|
||||||
|
|
||||||
|
ctx := lcli.ReqContext(cctx)
|
||||||
|
return api.MpoolClear(ctx, local)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user