version

package
v0.0.0-...-9eea1c9 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// The full version string
	Version = "1.0.6"
	// GitCommit is set with --ldflags "-X main.gitCommit=$(git rev-parse HEAD)"
	GitCommit string
	Status    *UpdateStatus
)

Functions

func CompatibleWith

func CompatibleWith(remoteVerStr string) (bool, error)

CompatibleWith checks whether the remote peer version is compatible with the node itself. RULES: | local | remote | | - | - | | 1.0.3 | same major&moinor version. | | 1.0.4 | same major version. |

Types

type UpdateStatus

type UpdateStatus struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*UpdateStatus) AddSeed

func (s *UpdateStatus) AddSeed(seedAddr string)

func (*UpdateStatus) CheckUpdate

func (s *UpdateStatus) CheckUpdate(localVerStr string, remoteVerStr string, remoteAddr string) error

CheckUpdate checks whether there is a newer version to update. If there is, it set the "Status" variable to a proper value.

params:
	localVerStr: the version of the node itself
	remoteVerStr: the version received from a seed node.
	remoteAddr: the version received from a seed node.

current rule:

  1. small update: seed version is higher than the node itself
  2. significant update: seed mojor version is higher than the node itself

func (*UpdateStatus) MaxVerSeen

func (s *UpdateStatus) MaxVerSeen() string

func (*UpdateStatus) VersionStatus

func (s *UpdateStatus) VersionStatus() uint16

Jump to

Keyboard shortcuts

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