Merge pull request #2001 from filecoin-project/asr/fetch-params-cli
Improve UX of fetch-params
This commit is contained in:
commit
9fbc7aafb4
@ -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'
|
||||
|
@ -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)
|
||||
|
||||
|
@ -8,7 +8,7 @@ make 2k
|
||||
|
||||
Download the 2048 byte parameters:
|
||||
```sh
|
||||
./lotus fetch-params --proving-params 2048
|
||||
./lotus fetch-params 2048
|
||||
```
|
||||
|
||||
Pre-seal some sectors:
|
||||
|
Loading…
Reference in New Issue
Block a user