Merge pull request #494 from filecoin-project/feat/handle-uncommited

storageminer: Handle uncommited sectors on start
This commit is contained in:
Łukasz Magiera
2019-10-30 15:32:34 +01:00
committed by GitHub
9 changed files with 231 additions and 16 deletions
+41
View File
@@ -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
},
}
+1
View File
@@ -26,6 +26,7 @@ func main() {
infoCmd,
storeGarbageCmd,
sectorsCmd,
commitmentsCmd,
}
jaeger := tracing.SetupJaegerTracing("lotus")
defer func() {