2022-05-12 13:42:00 +00:00
|
|
|
package build
|
|
|
|
|
2022-05-12 17:53:12 +00:00
|
|
|
import (
|
|
|
|
_ "embed"
|
|
|
|
|
|
|
|
"github.com/filecoin-project/lotus/chain/actors"
|
|
|
|
)
|
|
|
|
|
2022-05-12 13:42:00 +00:00
|
|
|
var NetworkBundle string
|
2022-05-12 17:53:12 +00:00
|
|
|
|
2022-05-16 19:02:37 +00:00
|
|
|
func GetNetworkBundle() string {
|
|
|
|
switch NetworkBundle {
|
2022-05-18 15:04:10 +00:00
|
|
|
case "devnet", "2k", "debug":
|
2022-05-16 19:02:37 +00:00
|
|
|
return "devnet"
|
|
|
|
case "calibnet", "calibrationnet":
|
|
|
|
return "calibrationnet"
|
|
|
|
case "butterflynet":
|
|
|
|
return "butterflynet"
|
|
|
|
case "interopnet", "caterpillarnet":
|
|
|
|
return "caterpillarnet"
|
|
|
|
default:
|
|
|
|
return "mainnet"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-12 18:14:03 +00:00
|
|
|
//go:embed bundles.toml
|
2022-05-12 17:53:12 +00:00
|
|
|
var BuiltinActorBundles []byte
|
|
|
|
|
|
|
|
type BundleSpec struct {
|
|
|
|
Bundles []Bundle
|
|
|
|
}
|
|
|
|
|
|
|
|
type Bundle struct {
|
2022-05-16 18:48:12 +00:00
|
|
|
// Version is the actors version in this bundle
|
2022-05-12 17:53:12 +00:00
|
|
|
Version actors.Version
|
2022-05-16 18:48:12 +00:00
|
|
|
// Release is the release id
|
2022-05-12 17:53:12 +00:00
|
|
|
Release string
|
2022-05-17 17:38:32 +00:00
|
|
|
// Path is the (optional) bundle path; takes precedence over url
|
2022-05-17 18:45:17 +00:00
|
|
|
Path map[string]string
|
2022-05-17 17:38:32 +00:00
|
|
|
// URL is the (optional) bundle URL; takes precdence over github release
|
2022-05-17 18:45:17 +00:00
|
|
|
URL map[string]BundleURL
|
2022-05-16 18:48:12 +00:00
|
|
|
// Devlopment indicates whether this is a development version; when set, in conjunction with path,
|
2022-05-16 19:47:19 +00:00
|
|
|
// it will always load the bundle to the blockstore, without recording the manifest CID in the
|
|
|
|
// datastore.
|
2022-05-16 18:09:09 +00:00
|
|
|
Development bool
|
2022-05-12 17:53:12 +00:00
|
|
|
}
|
2022-05-17 18:45:17 +00:00
|
|
|
|
|
|
|
type BundleURL struct {
|
|
|
|
// URL is the url of the bundle
|
|
|
|
URL string
|
|
|
|
// Checksum is the sha256 checksum of the bundle
|
|
|
|
Checksum string
|
|
|
|
}
|