version

package
v1.11.2-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: BSD-3-Clause Imports: 13 Imported by: 163

Documentation

Index

Constants

View Source
const (
	Client = "avalanchego"
	// RPCChainVMProtocol should be bumped anytime changes are made which
	// require the plugin vm to upgrade to latest avalanchego release to be
	// compatible.
	RPCChainVMProtocol uint = 33
)
View Source
const LegacyAppName = "avalanche"

Variables

View Source
var (
	Current = &Semantic{
		Major: 1,
		Minor: 11,
		Patch: 0,
	}
	CurrentApp = &Application{
		Name:  Client,
		Major: Current.Major,
		Minor: Current.Minor,
		Patch: Current.Patch,
	}
	MinimumCompatibleVersion = &Application{
		Name:  Client,
		Major: 1,
		Minor: 11,
		Patch: 0,
	}
	PrevMinimumCompatibleVersion = &Application{
		Name:  Client,
		Major: 1,
		Minor: 10,
		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,
	}

	// RPCChainVMProtocolCompatibility maps RPCChainVMProtocol versions to the
	// set of avalanchego versions that supported that version. This is not used
	// by avalanchego, but is useful for downstream libraries.
	RPCChainVMProtocolCompatibility map[uint][]*Semantic

	DefaultUpgradeTime = 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),
	}

	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),
	}

	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),
	}

	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),
	}
	ApricotPhase4MinPChainHeight = map[uint32]uint64{
		constants.MainnetID: 793005,
		constants.FujiID:    47437,
	}

	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),
	}

	ApricotPhasePre6Times = map[uint32]time.Time{
		constants.MainnetID: time.Date(2022, time.September, 5, 1, 30, 0, 0, time.UTC),
		constants.FujiID:    time.Date(2022, time.September, 6, 20, 0, 0, 0, time.UTC),
	}

	ApricotPhase6Times = map[uint32]time.Time{
		constants.MainnetID: time.Date(2022, time.September, 6, 20, 0, 0, 0, time.UTC),
		constants.FujiID:    time.Date(2022, time.September, 6, 20, 0, 0, 0, time.UTC),
	}

	ApricotPhasePost6Times = map[uint32]time.Time{
		constants.MainnetID: time.Date(2022, time.September, 7, 3, 0, 0, 0, time.UTC),
		constants.FujiID:    time.Date(2022, time.September, 7, 6, 0, 0, 0, time.UTC),
	}

	BanffTimes = map[uint32]time.Time{
		constants.MainnetID: time.Date(2022, time.October, 18, 16, 0, 0, 0, time.UTC),
		constants.FujiID:    time.Date(2022, time.October, 3, 14, 0, 0, 0, time.UTC),
	}

	CortinaTimes = map[uint32]time.Time{
		constants.MainnetID: time.Date(2023, time.April, 25, 15, 0, 0, 0, time.UTC),
		constants.FujiID:    time.Date(2023, time.April, 6, 15, 0, 0, 0, time.UTC),
	}
	CortinaXChainStopVertexID = map[uint32]ids.ID{

		constants.MainnetID: ids.FromStringOrPanic("jrGWDh5Po9FMj54depyunNixpia5PN4aAYxfmNzU8n752Rjga"),

		constants.FujiID: ids.FromStringOrPanic("2D1cmbiG36BqQMRyHt4kFhWarmatA1ighSpND3FeFgz3vFVtCZ"),
	}

	DurangoTimes = map[uint32]time.Time{
		constants.MainnetID: time.Date(2024, time.March, 6, 16, 0, 0, 0, time.UTC),
		constants.FujiID:    time.Date(2024, time.February, 13, 16, 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 GetApricotPhase1Time added in v1.4.5

func GetApricotPhase1Time(networkID uint32) time.Time

func GetApricotPhase2Time added in v1.4.5

func GetApricotPhase2Time(networkID uint32) time.Time

func GetApricotPhase3Time added in v1.5.0

func GetApricotPhase3Time(networkID uint32) time.Time

func GetApricotPhase4Time added in v1.6.0

func GetApricotPhase4Time(networkID uint32) time.Time

func GetApricotPhase5Time added in v1.7.0

func GetApricotPhase5Time(networkID uint32) time.Time

func GetApricotPhase6Time added in v1.8.0

func GetApricotPhase6Time(networkID uint32) time.Time

func GetApricotPhasePost6Time added in v1.10.19

func GetApricotPhasePost6Time(networkID uint32) time.Time

func GetApricotPhasePre6Time added in v1.10.19

func GetApricotPhasePre6Time(networkID uint32) time.Time

func GetBanffTime added in v1.9.0

func GetBanffTime(networkID uint32) time.Time

func GetCortinaTime added in v1.9.12

func GetCortinaTime(networkID uint32) time.Time

func GetDurangoTime added in v1.10.17

func GetDurangoTime(networkID uint32) time.Time

Types

type Application added in v1.4.5

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

func ParseLegacyApplication added in v1.10.18

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

TODO: Remove after v1.11.x is activated

func (*Application) Before added in v1.4.5

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

func (*Application) Compare added in v1.7.14

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 added in v1.4.5

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

func (*Application) String added in v1.7.14

func (a *Application) String() string

The only difference here between Application and Semantic is that Application prepends the client name rather than "v".

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
}

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,
) Compatibility

NewCompatibility returns a compatibility checker with the provided options

type Semantic added in v1.7.14

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.7.14

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

func (*Semantic) Compare added in v1.7.14

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.7.14

func (s *Semantic) String() string

The only difference here between Semantic and Application is that Semantic prepends "v" rather than the client name.

Jump to

Keyboard shortcuts

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