From 2c401f90419535543e8f811c9ff4062959ff2e6c Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Fri, 12 Jun 2020 01:13:11 -0400 Subject: [PATCH 1/2] Improve UX of fetch-params --- .circleci/config.yml | 2 +- cli/params.go | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ddcbd5481..fc9f495a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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' diff --git a/cli/params.go b/cli/params.go index 95596ff57..47e1e3988 100644 --- a/cli/params.go +++ b/cli/params.go @@ -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) From 227819dc1e43fd9c64022fc3b79cb2ca907bc62c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 12 Jun 2020 10:03:31 +0200 Subject: [PATCH 2/2] docs: Update local-dev-net --- documentation/en/local-dev-net.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/en/local-dev-net.md b/documentation/en/local-dev-net.md index 0b352fe8a..e11d9b358 100644 --- a/documentation/en/local-dev-net.md +++ b/documentation/en/local-dev-net.md @@ -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: