Improve UX of fetch-params

This commit is contained in:
Aayush Rajasekaran 2020-06-12 01:13:11 -04:00
parent 9457df9ddd
commit 2c401f9041
2 changed files with 9 additions and 11 deletions

View File

@ -45,7 +45,7 @@ commands:
- 'v25-2k-lotus-params'
paths:
- /var/tmp/filecoin-proof-parameters/
- run: ./lotus fetch-params --proving-params 2048
- run: ./lotus fetch-params 2048
- save_cache:
name: Save parameters cache
key: 'v25-2k-lotus-params'

View File

@ -10,18 +10,16 @@ import (
)
var fetchParamCmd = &cli.Command{
Name: "fetch-params",
Usage: "Fetch proving parameters",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "proving-params",
Usage: "download params used creating proofs for given size, i.e. 32GiB",
},
},
Name: "fetch-params",
Usage: "Fetch proving parameters",
ArgsUsage: "[sectorSize]",
Action: func(cctx *cli.Context) error {
sectorSizeInt, err := units.RAMInBytes(cctx.String("proving-params"))
if !cctx.Args().Present() {
return xerrors.Errorf("must pass sector size to fetch params for (specify as \"32GiB\", for instance)")
}
sectorSizeInt, err := units.RAMInBytes(cctx.Args().First())
if err != nil {
return err
return xerrors.Errorf("error parsing sector size (specify as \"32GiB\", for instance): %w", err)
}
sectorSize := uint64(sectorSizeInt)