Merge pull request #494 from filecoin-project/feat/handle-uncommited
storageminer: Handle uncommited sectors on start
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
lcli "github.com/filecoin-project/lotus/cli"
|
||||
|
||||
"gopkg.in/urfave/cli.v2"
|
||||
)
|
||||
|
||||
var commitmentsCmd = &cli.Command{
|
||||
Name: "commitments",
|
||||
Usage: "interact with commitment tracker",
|
||||
Subcommands: []*cli.Command{
|
||||
commitmentsListCmd,
|
||||
},
|
||||
}
|
||||
|
||||
var commitmentsListCmd = &cli.Command{
|
||||
Name: "list",
|
||||
Usage: "List tracked sector commitments",
|
||||
Action: func(cctx *cli.Context) error {
|
||||
api, closer, err := lcli.GetStorageMinerAPI(cctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer closer()
|
||||
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
|
||||
comms, err := api.CommitmentsList(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, comm := range comms {
|
||||
fmt.Printf("%s:%d msg:%s, deals: %v\n", comm.Miner, comm.SectorID, comm.CommitMsg, comm.DealIDs)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
@@ -26,6 +26,7 @@ func main() {
|
||||
infoCmd,
|
||||
storeGarbageCmd,
|
||||
sectorsCmd,
|
||||
commitmentsCmd,
|
||||
}
|
||||
jaeger := tracing.SetupJaegerTracing("lotus")
|
||||
defer func() {
|
||||
|
||||
Reference in New Issue
Block a user