version

package
v1.11.11 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: BSD-3-Clause Imports: 13 Imported by: 3

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 = 36
)

Variables

View Source
var (
	Current = &Semantic{
		Major: 1,
		Minor: 11,
		Patch: 10,
	}
	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

	// Deprecated: This will be removed once coreth no longer uses it.
	ApricotPhase1Times = map[uint32]time.Time{
		constants.MainnetID: upgrade.Mainnet.ApricotPhase1Time,
		constants.FujiID:    upgrade.Fuji.ApricotPhase1Time,
	}

	// Deprecated: This will be removed once coreth no longer uses it.
	ApricotPhase2Times = map[uint32]time.Time{
		constants.MainnetID: upgrade.Mainnet.ApricotPhase2Time,
		constants.FujiID:    upgrade.Fuji.ApricotPhase2Time,
	}

	// Deprecated: This will be removed once coreth no longer uses it.
	ApricotPhase3Times = map[uint32]time.Time{
		constants.MainnetID: upgrade.Mainnet.ApricotPhase3Time,
		constants.FujiID:    upgrade.Fuji.ApricotPhase3Time,
	}

	// Deprecated: This will be removed once coreth no longer uses it.
	ApricotPhase4Times = map[uint32]time.Time{
		constants.MainnetID: upgrade.Mainnet.ApricotPhase4Time,
		constants.FujiID:    upgrade.Fuji.ApricotPhase4Time,
	}

	// Deprecated: This will be removed once coreth no longer uses it.
	ApricotPhase5Times = map[uint32]time.Time{
		constants.MainnetID: upgrade.Mainnet.ApricotPhase5Time,
		constants.FujiID:    upgrade.Fuji.ApricotPhase5Time,
	}

	// Deprecated: This will be removed once coreth no longer uses it.
	ApricotPhasePre6Times = map[uint32]time.Time{
		constants.MainnetID: upgrade.Mainnet.ApricotPhasePre6Time,
		constants.FujiID:    upgrade.Fuji.ApricotPhasePre6Time,
	}

	// Deprecated: This will be removed once coreth no longer uses it.
	ApricotPhase6Times = map[uint32]time.Time{
		constants.MainnetID: upgrade.Mainnet.ApricotPhase6Time,
		constants.FujiID:    upgrade.Fuji.ApricotPhase6Time,
	}

	// Deprecated: This will be removed once coreth no longer uses it.
	ApricotPhasePost6Times = map[uint32]time.Time{
		constants.MainnetID: upgrade.Mainnet.ApricotPhasePost6Time,
		constants.FujiID:    upgrade.Fuji.ApricotPhasePost6Time,
	}

	// Deprecated: This will be removed once coreth no longer uses it.
	BanffTimes = map[uint32]time.Time{
		constants.MainnetID: upgrade.Mainnet.BanffTime,
		constants.FujiID:    upgrade.Fuji.BanffTime,
	}

	// Deprecated: This will be removed once coreth no longer uses it.
	CortinaTimes = map[uint32]time.Time{
		constants.MainnetID: upgrade.Mainnet.CortinaTime,
		constants.FujiID:    upgrade.Fuji.CortinaTime,
	}

	// Deprecated: This will be removed once coreth no longer uses it.
	DurangoTimes = map[uint32]time.Time{
		constants.MainnetID: upgrade.Mainnet.DurangoTime,
		constants.FujiID:    upgrade.Fuji.DurangoTime,
	}

	// Deprecated: This will be removed once coreth no longer uses it.
	EUpgradeTimes = map[uint32]time.Time{
		constants.MainnetID: upgrade.Mainnet.EtnaTime,
		constants.FujiID:    upgrade.Fuji.EtnaTime,
	}
)

These are globals that describe network upgrades and node versions

View Source
var GitCommit string

GitCommit is set in the build script at compile time

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

This section is empty.

Types

type Application

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 (*Application) Before

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

func (*Application) Compare

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

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

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(minCompatibleTime time.Time) Compatibility

func NewCompatibility

func NewCompatibility(
	version *Application,
	minCompatible *Application,
	minCompatibleTime time.Time,
	prevMinCompatible *Application,
) Compatibility

NewCompatibility returns a compatibility checker with the provided options

type Semantic

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

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

func (*Semantic) Compare

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

func (s *Semantic) String() string

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

type Versions

type Versions struct {
	Application string `json:"application"`
	Database    string `json:"database"`
	RPCChainVM  uint64 `json:"rpcchainvm"`
	// Commit may be empty if GitCommit was not set at compile time
	Commit string `json:"commit"`
	Go     string `json:"go"`
}

Versions contains the versions relevant to a build of avalanchego. In addition to supporting construction of the string displayed by --version, it is used to produce the output of --version-json and can be used to unmarshal that output.

func GetVersions

func GetVersions() *Versions

func (*Versions) String

func (v *Versions) String() string

Jump to

Keyboard shortcuts

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