Stop requiring miner address / sector size for lotus client commP

At present, and at least for the medium term (even with the transition to NSE)
the structure of a piece (and thus commP) will remain identical for every size
of sector.

The offline deal flow would benefit greatly if the `lotus client commP`
interface is able to calculate commP without having access to a fully synced
sync, or without even being online.

This is particularly important for filecoin-discover, as we want to allow
miners to spot-check their purchased HDDs, way before they need to accept
the mainnet deal proposals.

See comment/links in node/impl/client/client.go for details on code flow
This commit is contained in:
Peter Rabbitson
2020-08-12 22:03:00 +02:00
parent 43586ed9a1
commit fd49ef8de6
4 changed files with 21 additions and 20 deletions
+4 -9
View File
@@ -174,7 +174,7 @@ var clientDropCmd = &cli.Command{
var clientCommPCmd = &cli.Command{
Name: "commP",
Usage: "Calculate the piece-cid (commP) of a CAR file",
ArgsUsage: "[inputFile minerAddress]",
ArgsUsage: "[inputFile]",
Flags: []cli.Flag{
&CidBaseFlag,
},
@@ -186,16 +186,11 @@ var clientCommPCmd = &cli.Command{
defer closer()
ctx := ReqContext(cctx)
if cctx.Args().Len() != 2 {
return fmt.Errorf("usage: commP <inputPath> <minerAddr>")
if cctx.Args().Len() != 1 {
return fmt.Errorf("usage: commP <inputPath>")
}
miner, err := address.NewFromString(cctx.Args().Get(1))
if err != nil {
return err
}
ret, err := api.ClientCalcCommP(ctx, cctx.Args().Get(0), miner)
ret, err := api.ClientCalcCommP(ctx, cctx.Args().Get(0))
if err != nil {
return err
}