common

package
v1.4.5-testnet Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBeaconID = "default"

DefaultBeaconID is the value used when beacon id has an empty value. This value should not be changed for backward-compatibility reasons

View Source
const DefaultChainHash = "default"

DefaultChainHash is the value used when chain hash has an empty value on requests from clients. This value should not be changed for backward-compatibility reasons

View Source
const LogsToSkip = 300

LogsToSkip is used to reduce log verbosity when doing bulk processes, issuing logs only every LogsToSkip steps this is currently set so that when processing past beacons it will give a log every ~2 seconds

View Source
const MultiBeaconFolder = "multibeacon"

MultiBeaconFolder is the name of the folder where the multi-beacon data is stored

Variables

View Source
var (
	COMMIT    = ""
	BUILDDATE = ""
)

Set via -ldflags. Example:

go install -ldflags "-X common.BUILDDATE=`date -u +%d/%m/%Y@%H:%M:%S` -X common.GITCOMMIT=`git rev-parse HEAD`

See the Makefile and the Dockerfile in the root directory of the repo

View Source
var ErrInvalidChainHash = errors.New("incorrect chain hash")

ErrInvalidChainHash means there was an error or a mismatch with the chain hash

View Source
var ErrNotPartOfGroup = errors.New("this node is not part of the group")

ErrNotPartOfGroup indicates that this node is not part of the group for a specific beacon ID

View Source
var ErrPeerNotFound = errors.New("peer not found")

ErrPeerNotFound indicates that a peer is not part of any group that this node knows of

Functions

func CompareBeaconIDs

func CompareBeaconIDs(id1, id2 string) bool

CompareBeaconIDs indicates if two different beacon ids are equivalent or not. It handles default values too.

func GetCanonicalBeaconID

func GetCanonicalBeaconID(id string) string

GetCanonicalBeaconID returns the correct beacon id.

func IsDefaultBeaconID

func IsDefaultBeaconID(beaconID string) bool

IsDefaultBeaconID indicates if the beacon id received is the default one or not. There is a direct relationship between an empty string and the reserved id "default". Internally, empty string is translated to "default" so we can create the beacon folder with a valid name.

Types

type Version

type Version struct {
	Major      uint32
	Minor      uint32
	Patch      uint32
	Prerelease string
}

func GetAppVersion

func GetAppVersion() Version

func (Version) IsCompatible

func (v Version) IsCompatible(verRcv Version) bool

func (Version) String

func (v Version) String() string

func (Version) ToProto

func (v Version) ToProto() *pbcommon.NodeVersion

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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