From 45fdcaea45ef5c1dc0a99c615072d492159b9924 Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Fri, 3 Jul 2020 17:05:59 -0400 Subject: [PATCH] Add CLI command to manually start sealing a sector --- cmd/lotus-storage-miner/sectors.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/cmd/lotus-storage-miner/sectors.go b/cmd/lotus-storage-miner/sectors.go index 09a963d06..563369c48 100644 --- a/cmd/lotus-storage-miner/sectors.go +++ b/cmd/lotus-storage-miner/sectors.go @@ -29,6 +29,7 @@ var sectorsCmd = &cli.Command{ sectorsPledgeCmd, sectorsRemoveCmd, sectorsMarkForUpgradeCmd, + sectorsStartSealCmd, }, } @@ -268,6 +269,30 @@ var sectorsMarkForUpgradeCmd = &cli.Command{ }, } +var sectorsStartSealCmd = &cli.Command{ + Name: "seal", + Usage: "Manually start sealing a sector (filling any unused space with junk)", + ArgsUsage: "", + Action: func(cctx *cli.Context) error { + nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx) + if err != nil { + return err + } + defer closer() + ctx := lcli.ReqContext(cctx) + if cctx.Args().Len() != 1 { + return xerrors.Errorf("must pass sector number") + } + + id, err := strconv.ParseUint(cctx.Args().Get(0), 10, 64) + if err != nil { + return xerrors.Errorf("could not parse sector number: %w", err) + } + + return nodeApi.SectorStartSealing(ctx, abi.SectorNumber(id)) + }, +} + var sectorsUpdateCmd = &cli.Command{ Name: "update-state", Usage: "ADVANCED: manually update the state of a sector, this may aid in error recovery",