2019-10-02 20:29:40 +00:00
|
|
|
package build
|
|
|
|
|
2019-12-19 21:06:25 +00:00
|
|
|
import (
|
2021-05-28 06:52:19 +00:00
|
|
|
"embed"
|
|
|
|
"path"
|
|
|
|
|
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
|
|
|
|
2021-05-28 06:52:19 +00:00
|
|
|
//go:embed genesis
|
|
|
|
var genesisfs embed.FS
|
|
|
|
|
2019-10-02 20:29:40 +00:00
|
|
|
func MaybeGenesis() []byte {
|
2021-05-28 06:52:19 +00:00
|
|
|
genBytes, err := genesisfs.ReadFile(path.Join("genesis", 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 nil
|
|
|
|
}
|
|
|
|
return genBytes
|
|
|
|
}
|