lotus/cmd/lotus-shed/params.go

37 lines
888 B
Go
Raw Normal View History

2020-05-07 05:20:17 +00:00
package main
import (
"github.com/docker/go-units"
"github.com/urfave/cli/v2"
2020-06-05 22:59:01 +00:00
"golang.org/x/xerrors"
2020-05-07 05:20:17 +00:00
"github.com/filecoin-project/go-paramfetch"
2023-11-14 00:06:11 +00:00
2020-05-07 05:20:17 +00:00
"github.com/filecoin-project/lotus/build"
2022-06-14 15:00:51 +00:00
lcli "github.com/filecoin-project/lotus/cli"
2020-05-07 05:20:17 +00:00
)
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",
},
},
Action: func(cctx *cli.Context) error {
sectorSizeInt, err := units.RAMInBytes(cctx.String("proving-params"))
if err != nil {
return err
}
sectorSize := uint64(sectorSizeInt)
2021-03-10 15:16:44 +00:00
err = paramfetch.GetParams(lcli.ReqContext(cctx), build.ParametersJSON(), build.SrsJSON(), sectorSize)
2020-05-07 05:20:17 +00:00
if err != nil {
return xerrors.Errorf("fetching proof parameters: %w", err)
}
return nil
},
}