lotus/cli/params.go

35 lines
811 B
Go
Raw Normal View History

2019-10-04 19:55:33 +00:00
package cli
import (
"github.com/docker/go-units"
2020-01-02 19:08:49 +00:00
paramfetch "github.com/filecoin-project/go-paramfetch"
2019-10-04 19:55:33 +00:00
"golang.org/x/xerrors"
"github.com/urfave/cli/v2"
"github.com/filecoin-project/lotus/build"
2019-10-04 19:55:33 +00:00
)
var fetchParamCmd = &cli.Command{
Name: "fetch-params",
Usage: "Fetch proving parameters",
Flags: []cli.Flag{
&cli.StringFlag{
2019-12-04 19:44:15 +00:00
Name: "proving-params",
Usage: "download params used creating proofs for given size, i.e. 32GiB",
},
},
2019-10-04 19:55:33 +00:00
Action: func(cctx *cli.Context) error {
sectorSizeInt, err := units.RAMInBytes(cctx.String("proving-params"))
if err != nil {
return err
}
sectorSize := uint64(sectorSizeInt)
err = paramfetch.GetParams(build.ParametersJSON(), sectorSize)
if err != nil {
2019-10-04 19:55:33 +00:00
return xerrors.Errorf("fetching proof parameters: %w", err)
}
return nil
},
}