version

package
v0.2012.4 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: Apache-2.0 Imports: 6 Imported by: 21

Documentation

Overview

Package version implements Oasis protocol and runtime versioning.

Index

Constants

View Source
const VersionUndefined = "undefined"

VersionUndefined represents an undefined version.

Variables

View Source
var (
	// SoftwareVersion represents the Oasis Core's version and should be set
	// by the linker.
	SoftwareVersion = "0.0-unset"

	// GitBranch is the name of the git branch of Oasis Core.
	//
	// This is mostly used for reporting and metrics.
	GitBranch = ""

	// RuntimeHostProtocol versions the protocol between the Oasis node(s) and
	// the runtime.
	//
	// NOTE: This version must be synced with runtime/src/common/version.rs.
	RuntimeHostProtocol = Version{Major: 1, Minor: 0, Patch: 0}

	// RuntimeCommitteeProtocol versions the P2P protocol used by the runtime
	// committee members.
	RuntimeCommitteeProtocol = Version{Major: 1, Minor: 0, Patch: 0}

	// ConsensusProtocol versions all data structures and processing used by
	// the epochtime, beacon, registry, roothash, etc. modules that are
	// backend by consensus.
	//
	// NOTE: Any change in the major or minor versions are considered
	//       breaking changes for the protocol.
	ConsensusProtocol = Version{Major: 2, Minor: 0, Patch: 0}

	// Tendermint exposes the tendermint core version.
	Tendermint = parseSemVerStr(version.TMCoreSemVer)

	// ABCI is the version of the tendermint ABCI library.
	ABCI = parseSemVerStr(version.ABCIVersion)

	// Toolchain is the version of the Go compiler/standard library.
	Toolchain = parseSemVerStr(strings.TrimPrefix(runtime.Version(), "go"))
)
View Source
var Versions = struct {
	RuntimeHostProtocol      Version
	RuntimeCommitteeProtocol Version
	ConsensusProtocol        Version
	Tendermint               Version
	ABCI                     Version
	Toolchain                Version
}{
	RuntimeHostProtocol,
	RuntimeCommitteeProtocol,
	ConsensusProtocol,
	Tendermint,
	ABCI,
	Toolchain,
}

Versions contains all known protocol versions.

Functions

func ConvertGoModulesVersion added in v0.2012.3

func ConvertGoModulesVersion(goModVersion string) string

Convert Go Modules compatible version to Oasis Core's canonical version.

Types

type Version

type Version struct {
	Major uint16 `json:"major,omitempty"`
	Minor uint16 `json:"minor,omitempty"`
	Patch uint16 `json:"patch,omitempty"`
}

Version is a protocol or a runtime version.

func FromU64

func FromU64(v uint64) Version

FromU64 returns the version from platform-dependent uint64.

func (Version) MajorMinor

func (v Version) MajorMinor() Version

MajorMinor extracts major and minor segments of the Version only.

This is useful for comparing protocol version since the patch segment can be ignored.

func (Version) String

func (v Version) String() string

String returns the protocol version as a string.

func (Version) ToU64

func (v Version) ToU64() uint64

ToU64 returns the version as platform-dependent uint64.

Jump to

Keyboard shortcuts

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