cli: add retry for deals stuck in Publish with no funds

This commit is contained in:
Anton Evangelatov
2021-10-11 14:03:55 +02:00
parent b4302df892
commit 6e5ccc87cf
13 changed files with 194 additions and 3 deletions
+29
View File
@@ -352,6 +352,7 @@ var storageDealsCmd = &cli.Command{
resetBlocklistCmd,
setSealDurationCmd,
dealsPendingPublish,
dealsRetryPublish,
},
}
@@ -910,6 +911,34 @@ var dealsPendingPublish = &cli.Command{
},
}
var dealsRetryPublish = &cli.Command{
Name: "retry-publish",
Usage: "retry publishing a deal",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "proposal-cid",
},
},
Action: func(cctx *cli.Context) error {
api, closer, err := lcli.GetMarketsAPI(cctx)
if err != nil {
return err
}
defer closer()
ctx := lcli.ReqContext(cctx)
cid, err := cid.Decode(cctx.String("proposal-cid"))
if err != nil {
return err
}
if err := api.MarketRetryPublishDeal(ctx, cid); err != nil {
return xerrors.Errorf("retrying publishing deal: %w", err)
}
fmt.Println("retried to publish deal")
return nil
},
}
func listDealsWithJSON(cctx *cli.Context) error {
node, closer, err := lcli.GetMarketsAPI(cctx)
if err != nil {