Add a SyncUnmarkBad CLI
This commit is contained in:
parent
5c852e26c2
commit
93a0052219
26
cli/sync.go
26
cli/sync.go
@ -20,6 +20,7 @@ var syncCmd = &cli.Command{
|
|||||||
syncStatusCmd,
|
syncStatusCmd,
|
||||||
syncWaitCmd,
|
syncWaitCmd,
|
||||||
syncMarkBadCmd,
|
syncMarkBadCmd,
|
||||||
|
syncUnmarkBadCmd,
|
||||||
syncCheckBadCmd,
|
syncCheckBadCmd,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -117,6 +118,31 @@ var syncMarkBadCmd = &cli.Command{
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var syncUnmarkBadCmd = &cli.Command{
|
||||||
|
Name: "unmark-bad",
|
||||||
|
Usage: "Unmark the given block as bad, makes it possible to sync to a chain containing it",
|
||||||
|
ArgsUsage: "[blockCid]",
|
||||||
|
Action: func(cctx *cli.Context) error {
|
||||||
|
napi, closer, err := GetFullNodeAPI(cctx)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer closer()
|
||||||
|
ctx := ReqContext(cctx)
|
||||||
|
|
||||||
|
if !cctx.Args().Present() {
|
||||||
|
return fmt.Errorf("must specify block cid to unmark")
|
||||||
|
}
|
||||||
|
|
||||||
|
bcid, err := cid.Decode(cctx.Args().First())
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to decode input as a cid: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return napi.SyncUnmarkBad(ctx, bcid)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
var syncCheckBadCmd = &cli.Command{
|
var syncCheckBadCmd = &cli.Command{
|
||||||
Name: "check-bad",
|
Name: "check-bad",
|
||||||
Usage: "check if the given block was marked bad, and for what reason",
|
Usage: "check if the given block was marked bad, and for what reason",
|
||||||
|
Loading…
Reference in New Issue
Block a user