version

package
v1.7.17-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2022 License: BSD-3-Clause Imports: 8 Imported by: 48

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Current = &Semantic{
		Major: 1,
		Minor: 7,
		Patch: 17,
	}
	CurrentApp = &Application{
		Major: Current.Major,
		Minor: Current.Minor,
		Patch: Current.Patch,
	}
	MinimumCompatibleVersion = &Application{
		Major: 1,
		Minor: 7,
		Patch: 0,
	}
	PrevMinimumCompatibleVersion = &Application{
		Major: 1,
		Minor: 6,
		Patch: 0,
	}

	CurrentDatabase = DatabaseVersion1_4_5
	PrevDatabase    = DatabaseVersion1_0_0

	DatabaseVersion1_4_5 = &Semantic{
		Major: 1,
		Minor: 4,
		Patch: 5,
	}
	DatabaseVersion1_0_0 = &Semantic{
		Major: 1,
		Minor: 0,
		Patch: 0,
	}

	ApricotPhase3Times = map[uint32]time.Time{
		constants.MainnetID: time.Date(2020, time.December, 5, 5, 0, 0, 0, time.UTC),
		constants.TahoeID:   time.Date(2020, time.December, 5, 5, 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(2020, time.December, 5, 5, 0, 0, 0, time.UTC),
		constants.TahoeID:   time.Date(2020, time.December, 5, 5, 0, 0, 0, time.UTC),
	}
	ApricotPhase4DefaultTime     = time.Date(2020, time.December, 5, 5, 0, 0, 0, time.UTC)
	ApricotPhase4MinPChainHeight = map[uint32]uint64{
		constants.MainnetID: 0,
		constants.TahoeID:   0,
	}
	ApricotPhase4DefaultMinPChainHeight uint64

	ApricotPhase5Times = map[uint32]time.Time{
		constants.MainnetID: time.Date(2020, time.December, 5, 5, 0, 0, 0, time.UTC),
		constants.TahoeID:   time.Date(2020, time.December, 5, 5, 0, 0, 0, time.UTC),
	}
	ApricotPhase5DefaultTime = time.Date(2020, time.December, 5, 5, 0, 0, 0, time.UTC)

	// FIXME: update this before release
	BlueberryTimes = map[uint32]time.Time{
		constants.MainnetID: time.Date(10000, time.December, 1, 0, 0, 0, 0, time.UTC),
		constants.TahoeID:   time.Date(10000, time.December, 1, 0, 0, 0, 0, time.UTC),
	}
	BlueberryDefaultTime = 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(2020, time.December, 5, 5, 0, 0, 0, time.UTC),
		constants.TahoeID:   time.Date(2020, time.December, 5, 5, 0, 0, 0, time.UTC),
	}
	XChainMigrationDefaultTime = time.Date(2020, time.December, 5, 5, 0, 0, 0, time.UTC)
)

These are globals that describe network upgrades and node versions

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 (
	// V1_0_0 is a useful version to use in tests
	Semantic1_0_0 = &Semantic{
		Major: 1,
		Minor: 0,
		Patch: 0,
	}
)

Functions

func GetApricotPhase3Time

func GetApricotPhase3Time(networkID uint32) time.Time

func GetApricotPhase4MinPChainHeight

func GetApricotPhase4MinPChainHeight(networkID uint32) uint64

func GetApricotPhase4Time

func GetApricotPhase4Time(networkID uint32) time.Time

func GetApricotPhase5Time

func GetApricotPhase5Time(networkID uint32) time.Time

func GetBlueberryTime added in v1.8.4

func GetBlueberryTime(networkID uint32) time.Time

func GetXChainMigrationTime

func GetXChainMigrationTime(networkID uint32) time.Time

Types

type Application

type Application struct {
	Major int `json:"major" yaml:"major"`
	Minor int `json:"minor" yaml:"minor"`
	Patch int `json:"patch" yaml:"patch"`
	// contains filtered or unexported fields
}

func ParseApplication added in v1.8.4

func ParseApplication(s string) (*Application, error)

func (*Application) Before

func (a *Application) Before(o *Application) bool

func (*Application) Compare added in v1.8.4

func (a *Application) Compare(o *Application) int

Compare returns a positive number if s > o, 0 if s == o, or a negative number if s < o.

func (*Application) Compatible

func (a *Application) Compatible(o *Application) error

func (*Application) String added in v1.8.4

func (a *Application) String() string

The only difference here between Application and Semantic is that Application prepends "avalanche/" rather than "v".

type Compatibility

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
}

Compatibility a utility for checking the compatibility of peer versions

func GetCompatibility

func GetCompatibility(networkID uint32) Compatibility

func NewCompatibility

func NewCompatibility(
	version *Application,
	minCompatable *Application,
	minCompatableTime time.Time,
	prevMinCompatable *Application,
) Compatibility

NewCompatibility returns a compatibility checker with the provided options

type Semantic added in v1.8.4

type Semantic struct {
	Major int `json:"major" yaml:"major"`
	Minor int `json:"minor" yaml:"minor"`
	Patch int `json:"patch" yaml:"patch"`
	// contains filtered or unexported fields
}

func Parse added in v1.8.4

func Parse(s string) (*Semantic, error)

func (*Semantic) Compare added in v1.8.4

func (s *Semantic) Compare(o *Semantic) int

Compare returns a positive number if s > o, 0 if s == o, or a negative number if s < o.

func (*Semantic) String added in v1.8.4

func (s *Semantic) String() string

The only difference here between Semantic and Application is that Semantic prepends "v" rather than "avalanche/".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL