lotus/build/genesis.go

24 lines
408 B
Go
Raw Normal View History

2019-10-02 20:29:40 +00:00
package build
import (
2021-05-28 06:52:19 +00:00
"embed"
"path"
logging "github.com/ipfs/go-log/v2"
)
// moved from now-defunct build/paramfetch.go
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 {
log.Warnf("loading built-in genesis: %s", err)
2019-10-02 20:29:40 +00:00
return nil
}
return genBytes
}