version

package
v0.20.9 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 5 Imported by: 21

Documentation

Overview

Package version implements Oasis protocol and runtime versioning.

Index

Constants

This section is empty.

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: 0, Minor: 15, Patch: 0}

	// RuntimeCommitteeProtocol versions the P2P protocol used by the runtime
	// committee members.
	RuntimeCommitteeProtocol = Version{Major: 0, Minor: 10, 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: 0, Minor: 26, 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

This section is empty.

Types

type Version

type Version struct {
	Major uint16
	Minor uint16
	Patch uint16
}

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