lotus/cmd/lotus-shed/main.go
jennijuju 277d3e9ab4 Add terminate sectors based on 1475's #4433 implementation in lotus-shed:
-  Moving the cmd to lotus-shed so that miners can use this right away without waiting for fsm changes.- Note: this should only be used when the miner is 100% sure that they want to terminate the sector on chain and they will be lose the power and pay a big one-time termination penalty for the sectors.
- Only live sectors can be terminated.
- To use, run `./lotus-shed sectors terminate --really-do-it=true sectorNum1 sectorNum2`.
- A message will be sent and after the message is landed on chain, miner can run `lotus-miner sectors status --on-chain-info <terminated sector number>`, and check Expiration Info at the bottom. Both `OnTime` and `Early` are 0 indicates the sector is terminated.
2020-10-20 17:38:09 -04:00

76 lines
1.3 KiB
Go

package main
import (
"os"
logging "github.com/ipfs/go-log/v2"
"github.com/urfave/cli/v2"
"github.com/filecoin-project/lotus/build"
)
var log = logging.Logger("lotus-shed")
func main() {
logging.SetLogLevel("*", "INFO")
local := []*cli.Command{
base32Cmd,
base16Cmd,
bitFieldCmd,
keyinfoCmd,
jwtCmd,
noncefix,
bigIntParseCmd,
staterootCmd,
auditsCmd,
importCarCmd,
importObjectCmd,
commpToCidCmd,
fetchParamCmd,
proofsCmd,
verifRegCmd,
miscCmd,
mpoolCmd,
genesisVerifyCmd,
mathCmd,
mpoolStatsCmd,
exportChainCmd,
consensusCmd,
serveDealStatsCmd,
syncCmd,
stateTreePruneCmd,
datastoreCmd,
ledgerCmd,
sectorsCmd,
}
app := &cli.App{
Name: "lotus-shed",
Usage: "A place for all the lotus tools",
Version: build.BuildVersion,
Commands: local,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "repo",
EnvVars: []string{"LOTUS_PATH"},
Hidden: true,
Value: "~/.lotus", // TODO: Consider XDG_DATA_HOME
},
&cli.StringFlag{
Name: "log-level",
Value: "info",
},
},
Before: func(cctx *cli.Context) error {
return logging.SetLogLevel("lotus-shed", cctx.String("log-level"))
},
}
if err := app.Run(os.Args); err != nil {
log.Warnf("%+v", err)
os.Exit(1)
return
}
}