2019-10-02 20:29:40 +00:00
|
|
|
package build
|
|
|
|
|
2019-12-19 21:06:25 +00:00
|
|
|
import (
|
|
|
|
rice "github.com/GeertJohan/go.rice"
|
2020-01-08 19:10:57 +00:00
|
|
|
logging "github.com/ipfs/go-log/v2"
|
2019-12-19 21:06:25 +00:00
|
|
|
)
|
|
|
|
|
2019-12-20 18:49:11 +00:00
|
|
|
// moved from now-defunct build/paramfetch.go
|
2019-12-19 21:06:25 +00:00
|
|
|
var log = logging.Logger("build")
|
2019-10-02 20:29:40 +00:00
|
|
|
|
|
|
|
func MaybeGenesis() []byte {
|
|
|
|
builtinGen, err := rice.FindBox("genesis")
|
|
|
|
if err != nil {
|
2020-01-08 19:06:36 +00:00
|
|
|
log.Warnf("loading built-in genesis: %s", err)
|
2019-10-02 20:29:40 +00:00
|
|
|
return nil
|
|
|
|
}
|
2021-01-05 05:32:15 +00:00
|
|
|
genBytes, err := builtinGen.Bytes(GenesisFile)
|
2019-10-02 20:29:40 +00:00
|
|
|
if err != nil {
|
2020-01-08 19:06:36 +00:00
|
|
|
log.Warnf("loading built-in genesis: %s", err)
|
2019-10-02 20:29:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return genBytes
|
|
|
|
}
|