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'
|
- 'v25-2k-lotus-params'
|
||||||
paths:
|
paths:
|
||||||
- /var/tmp/filecoin-proof-parameters/
|
- /var/tmp/filecoin-proof-parameters/
|
||||||
- run: ./lotus fetch-params --proving-params 2048
|
- run: ./lotus fetch-params 2048
|
||||||
- save_cache:
|
- save_cache:
|
||||||
name: Save parameters cache
|
name: Save parameters cache
|
||||||
key: 'v25-2k-lotus-params'
|
key: 'v25-2k-lotus-params'
|
||||||
|
@ -12,16 +12,14 @@ import (
|
|||||||
var fetchParamCmd = &cli.Command{
|
var fetchParamCmd = &cli.Command{
|
||||||
Name: "fetch-params",
|
Name: "fetch-params",
|
||||||
Usage: "Fetch proving parameters",
|
Usage: "Fetch proving parameters",
|
||||||
Flags: []cli.Flag{
|
ArgsUsage: "[sectorSize]",
|
||||||
&cli.StringFlag{
|
|
||||||
Name: "proving-params",
|
|
||||||
Usage: "download params used creating proofs for given size, i.e. 32GiB",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Action: func(cctx *cli.Context) error {
|
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 {
|
if err != nil {
|
||||||
return err
|
return xerrors.Errorf("error parsing sector size (specify as \"32GiB\", for instance): %w", err)
|
||||||
}
|
}
|
||||||
sectorSize := uint64(sectorSizeInt)
|
sectorSize := uint64(sectorSizeInt)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ make 2k
|
|||||||
|
|
||||||
Download the 2048 byte parameters:
|
Download the 2048 byte parameters:
|
||||||
```sh
|
```sh
|
||||||
./lotus fetch-params --proving-params 2048
|
./lotus fetch-params 2048
|
||||||
```
|
```
|
||||||
|
|
||||||
Pre-seal some sectors:
|
Pre-seal some sectors:
|
||||||
|
Loading…
Reference in New Issue
Block a user