sanity check: make sure proof parameters are present; add Makefile for easy download.
This commit is contained in:
parent
6eb5e24988
commit
69332e1189
7
Makefile
Normal file
7
Makefile
Normal file
@ -0,0 +1,7 @@
|
||||
SHELL = /bin/bash
|
||||
|
||||
.DEFAULT_GOAL := download-proofs
|
||||
|
||||
download-proofs:
|
||||
go run github.com/filecoin-project/go-paramfetch/paramfetch 2048 ./docker-images/proof-parameters.json
|
||||
.PHONY: download-proofs
|
@ -14,31 +14,9 @@ var cases = map[string]interface{}{
|
||||
"paych-stress": testkit.WrapTestEnvironment(paych.Stress),
|
||||
}
|
||||
|
||||
func init() {
|
||||
build.BlockDelaySecs = 2
|
||||
build.PropagationDelaySecs = 4
|
||||
|
||||
_ = logging.SetLogLevel("*", "WARN")
|
||||
_ = logging.SetLogLevel("dht/RtRefreshManager", "ERROR") // noisy
|
||||
_ = logging.SetLogLevel("bitswap", "ERROR") // noisy
|
||||
|
||||
_ = os.Setenv("BELLMAN_NO_GPU", "1")
|
||||
|
||||
build.InsecurePoStValidation = true
|
||||
build.DisableBuiltinAssets = true
|
||||
|
||||
// MessageConfidence is the amount of tipsets we wait after a message is
|
||||
// mined, e.g. payment channel creation, to be considered committed.
|
||||
build.MessageConfidence = 1
|
||||
|
||||
power.ConsensusMinerMinPower = big.NewInt(2048)
|
||||
miner.SupportedProofTypes = map[abi.RegisteredSealProof]struct{}{
|
||||
abi.RegisteredSealProof_StackedDrg2KiBV1: {},
|
||||
}
|
||||
verifreg.MinVerifiedDealSize = big.NewInt(256)
|
||||
|
||||
}
|
||||
|
||||
func main() {
|
||||
sanityCheck()
|
||||
|
||||
run.InvokeMap(cases)
|
||||
}
|
||||
|
||||
|
35
lotus-soup/sanity.go
Normal file
35
lotus-soup/sanity.go
Normal file
@ -0,0 +1,35 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
)
|
||||
|
||||
func sanityCheck() {
|
||||
enhanceMsg := func(msg string, a ...interface{}) string {
|
||||
return fmt.Sprintf("sanity check: "+msg+"; if running on local:exec, make sure to run `make` from the root of the oni repo", a...)
|
||||
}
|
||||
|
||||
dir := "/var/tmp/filecoin-proof-parameters"
|
||||
stat, err := os.Stat(dir)
|
||||
if os.IsNotExist(err) {
|
||||
panic(enhanceMsg("proofs parameters not available in /var/tmp/filecoin-proof-parameters"))
|
||||
}
|
||||
if err != nil {
|
||||
panic(enhanceMsg("failed to stat /var/tmp/filecoin-proof-parameters: %s", err))
|
||||
}
|
||||
|
||||
if !stat.IsDir() {
|
||||
panic(enhanceMsg("/var/tmp/filecoin-proof-parameters is not a directory; aborting"))
|
||||
}
|
||||
|
||||
files, err := ioutil.ReadDir(dir)
|
||||
if err != nil {
|
||||
panic(enhanceMsg("failed list directory /var/tmp/filecoin-proof-parameters: %s", err))
|
||||
}
|
||||
|
||||
if len(files) == 0 {
|
||||
panic(enhanceMsg("no files in /var/tmp/filecoin-proof-parameters"))
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user