Documentation ¶
Index ¶
- Variables
- func GetApricotPhase0Time(networkID uint32) time.Time
- func GetApricotPhase1Time(networkID uint32) time.Time
- func GetApricotPhase2Time(networkID uint32) time.Time
- func GetApricotPhase3Time(networkID uint32) time.Time
- func GetApricotPhase4MinPChainHeight(networkID uint32) uint64
- func GetApricotPhase4Time(networkID uint32) time.Time
- func GetApricotPhase5Time(networkID uint32) time.Time
- func GetXChainMigrationTime(networkID uint32) time.Time
- type Application
- type ApplicationParser
- type Compatibility
- type Parser
- type Version
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Current = NewDefaultVersion(1, 7, 11) CurrentApp = NewDefaultApplication(constants.PlatformName, Current.Major(), Current.Minor(), Current.Patch()) MinimumCompatibleVersion = NewDefaultApplication(constants.PlatformName, 1, 7, 0) PrevMinimumCompatibleVersion = NewDefaultApplication(constants.PlatformName, 1, 6, 0) MinimumUnmaskedVersion = NewDefaultApplication(constants.PlatformName, 1, 1, 0) PrevMinimumUnmaskedVersion = NewDefaultApplication(constants.PlatformName, 1, 0, 0) CurrentDatabase = DatabaseVersion1_4_5 PrevDatabase = DatabaseVersion1_0_0 DatabaseVersion1_4_5 = NewDefaultVersion(1, 4, 5) DatabaseVersion1_0_0 = NewDefaultVersion(1, 0, 0) ApricotPhase0Times = map[uint32]time.Time{ constants.MainnetID: time.Date(2020, time.December, 8, 3, 0, 0, 0, time.UTC), constants.FujiID: time.Date(2020, time.December, 5, 5, 0, 0, 0, time.UTC), } ApricotPhase0DefaultTime = time.Date(2020, time.December, 5, 5, 0, 0, 0, time.UTC) ApricotPhase1Times = map[uint32]time.Time{ constants.MainnetID: time.Date(2021, time.March, 31, 14, 0, 0, 0, time.UTC), constants.FujiID: time.Date(2021, time.March, 26, 14, 0, 0, 0, time.UTC), } ApricotPhase1DefaultTime = time.Date(2020, time.December, 5, 5, 0, 0, 0, time.UTC) ApricotPhase2Times = map[uint32]time.Time{ constants.MainnetID: time.Date(2021, time.May, 10, 11, 0, 0, 0, time.UTC), constants.FujiID: time.Date(2021, time.May, 5, 14, 0, 0, 0, time.UTC), } ApricotPhase2DefaultTime = time.Date(2020, time.December, 5, 5, 0, 0, 0, time.UTC) ApricotPhase3Times = map[uint32]time.Time{ constants.MainnetID: time.Date(2021, time.August, 24, 14, 0, 0, 0, time.UTC), constants.FujiID: time.Date(2021, time.August, 16, 19, 0, 0, 0, time.UTC), } ApricotPhase3DefaultTime = time.Date(2020, time.December, 5, 5, 0, 0, 0, time.UTC) ApricotPhase4Times = map[uint32]time.Time{ constants.MainnetID: time.Date(2021, time.September, 22, 21, 0, 0, 0, time.UTC), constants.FujiID: time.Date(2021, time.September, 16, 21, 0, 0, 0, time.UTC), } ApricotPhase4DefaultTime = time.Date(2020, time.December, 5, 5, 0, 0, 0, time.UTC) ApricotPhase4MinPChainHeight = map[uint32]uint64{ constants.MainnetID: 793005, constants.FujiID: 47437, } ApricotPhase4DefaultMinPChainHeight uint64 ApricotPhase5Times = map[uint32]time.Time{ constants.MainnetID: time.Date(2021, time.December, 2, 18, 0, 0, 0, time.UTC), constants.FujiID: time.Date(2021, time.November, 24, 15, 0, 0, 0, time.UTC), } ApricotPhase5DefaultTime = time.Date(2020, time.December, 5, 5, 0, 0, 0, time.UTC) // FIXME: update this before release XChainMigrationTimes = map[uint32]time.Time{ constants.MainnetID: time.Date(10000, time.December, 1, 0, 0, 0, 0, time.UTC), constants.FujiID: time.Date(10000, time.December, 1, 0, 0, 0, 0, time.UTC), } XChainMigrationDefaultTime = time.Date(2022, time.January, 1, 1, 0, 0, 0, time.UTC) )
These are globals that describe network upgrades and node versions
View Source
var ( DefaultParser = NewParser(defaultVersionPrefix, defaultVersionSeparator) DefaultApplicationParser = NewApplicationParser(defaultAppSeparator, defaultVersionSeparator) )
View Source
var ( // String is displayed when CLI arg --version is used String string // GitCommit is set in the build script at compile time GitCommit string )
View Source
var ( // DefaultVersion1_0_0 is a useful version to use in tests DefaultVersion1_0_0 = NewDefaultVersion(1, 0, 0) )
Functions ¶
func GetApricotPhase0Time ¶ added in v1.4.5
func GetApricotPhase1Time ¶ added in v1.4.5
func GetApricotPhase2Time ¶ added in v1.4.5
func GetApricotPhase3Time ¶ added in v1.5.0
func GetApricotPhase4MinPChainHeight ¶ added in v1.6.0
func GetApricotPhase4Time ¶ added in v1.6.0
func GetApricotPhase5Time ¶ added in v1.7.0
func GetXChainMigrationTime ¶ added in v1.7.6
Types ¶
type Application ¶ added in v1.4.5
type Application interface { Version App() string Compatible(Application) error Before(Application) bool }
Application defines what is needed to describe a versioned Application.
func NewApplication ¶ added in v1.4.5
func NewApplication( app string, appSeparator string, versionSeparator string, major int, minor int, patch int, ) Application
NewApplication returns a new version
func NewDefaultApplication ¶ added in v1.4.5
func NewDefaultApplication( app string, major int, minor int, patch int, ) Application
NewDefaultApplication returns a new version with default separators
type ApplicationParser ¶ added in v1.4.5
type ApplicationParser interface {
Parse(string) (Application, error)
}
ApplicationParser defines the interface of an ApplicationVersion parser
func NewApplicationParser ¶ added in v1.4.5
func NewApplicationParser(appSeparator string, versionSeparator string) ApplicationParser
NewApplicationParser returns a new parser
type Compatibility ¶ added in v1.3.2
type Compatibility interface { // Returns the local version Version() Application // Returns nil if the provided version is compatible with the local version. // This means that the version is connectable and that consensus messages // can be made to them. Compatible(Application) error // Returns nil if the provided version shouldn't be masked. This means that // the version is connectable but not compatible. The version is so old that // it should just be masked. Unmaskable(Application) error // Returns nil if the provided version will not be masked by this version. WontMask(Application) error // Returns when additional masking will occur. MaskTime() time.Time }
Compatibility a utility for checking the compatibility of peer versions
func GetCompatibility ¶ added in v1.4.5
func GetCompatibility(networkID uint32) Compatibility
func NewCompatibility ¶ added in v1.3.2
func NewCompatibility( version Application, minCompatable Application, minCompatableTime time.Time, prevMinCompatable Application, minUnmaskable Application, minUnmaskableTime time.Time, prevMinUnmaskable Application, ) Compatibility
NewCompatibility returns a compatibility checker with the provided options
Click to show internal directories.
Click to hide internal directories.