diff --git a/build/parameters.go b/build/parameters.go index 433fa497b..b7fac93d1 100644 --- a/build/parameters.go +++ b/build/parameters.go @@ -2,4 +2,6 @@ package build import rice "github.com/GeertJohan/go.rice" -var ParametersJson = rice.MustFindBox("proof-params").MustBytes("parameters.json") +func ParametersJson() []byte { + return rice.MustFindBox("proof-params").MustBytes("parameters.json") +} diff --git a/cli/params.go b/cli/params.go index 440c2bbdf..518add665 100644 --- a/cli/params.go +++ b/cli/params.go @@ -24,7 +24,7 @@ var fetchParamCmd = &cli.Command{ return err } sectorSize := uint64(sectorSizeInt) - err = paramfetch.GetParams(build.ParametersJson, sectorSize) + err = paramfetch.GetParams(build.ParametersJson(), sectorSize) if err != nil { return xerrors.Errorf("fetching proof parameters: %w", err) } diff --git a/cmd/lotus-bench/main.go b/cmd/lotus-bench/main.go index 86939459a..cb25bb23a 100644 --- a/cmd/lotus-bench/main.go +++ b/cmd/lotus-bench/main.go @@ -155,7 +155,7 @@ func main() { } } - if err := paramfetch.GetParams(build.ParametersJson, sectorSize); err != nil { + if err := paramfetch.GetParams(build.ParametersJson(), sectorSize); err != nil { return xerrors.Errorf("getting params: %w", err) } sb, err := sectorbuilder.New(cfg, mds) diff --git a/cmd/lotus-seal-worker/sub.go b/cmd/lotus-seal-worker/sub.go index f79c691c9..bf45c685b 100644 --- a/cmd/lotus-seal-worker/sub.go +++ b/cmd/lotus-seal-worker/sub.go @@ -41,7 +41,7 @@ func acceptJobs(ctx context.Context, api lapi.StorageMiner, endpoint string, aut return err } - if err := paramfetch.GetParams(build.ParametersJson, ssize); err != nil { + if err := paramfetch.GetParams(build.ParametersJson(), ssize); err != nil { return xerrors.Errorf("get params: %w", err) } diff --git a/cmd/lotus-storage-miner/init.go b/cmd/lotus-storage-miner/init.go index 18b31c9b6..b40b2e04e 100644 --- a/cmd/lotus-storage-miner/init.go +++ b/cmd/lotus-storage-miner/init.go @@ -97,7 +97,7 @@ var initCmd = &cli.Command{ } log.Info("Checking proof parameters") - if err := paramfetch.GetParams(build.ParametersJson, ssize); err != nil { + if err := paramfetch.GetParams(build.ParametersJson(), ssize); err != nil { return xerrors.Errorf("fetching proof parameters: %w", err) } diff --git a/cmd/lotus/daemon.go b/cmd/lotus/daemon.go index 7c5cb6d62..7f8806e6f 100644 --- a/cmd/lotus/daemon.go +++ b/cmd/lotus/daemon.go @@ -100,7 +100,7 @@ var DaemonCmd = &cli.Command{ return xerrors.Errorf("repo init error: %w", err) } - if err := paramfetch.GetParams(build.ParametersJson, 0); err != nil { + if err := paramfetch.GetParams(build.ParametersJson(), 0); err != nil { return xerrors.Errorf("fetching proof parameters: %w", err) } diff --git a/node/modules/storageminer.go b/node/modules/storageminer.go index 533946696..a34841c71 100644 --- a/node/modules/storageminer.go +++ b/node/modules/storageminer.go @@ -55,7 +55,7 @@ func minerAddrFromDS(ds dtypes.MetadataDS) (address.Address, error) { } func GetParams(sbc *sectorbuilder.Config) error { - if err := paramfetch.GetParams(build.ParametersJson, sbc.SectorSize); err != nil { + if err := paramfetch.GetParams(build.ParametersJson(), sbc.SectorSize); err != nil { return xerrors.Errorf("fetching proof parameters: %w", err) }