syncbeaconfollower

package
v0.2.4-0...-2c2ceb1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: Apache-2.0, BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PluginName is the plugin name of the sync beacon plugin.
	PluginName = "SyncBeaconFollower"

	// CfgSyncBeaconFollowNodes defines the list of nodes this node should follow to determine its sync status.
	CfgSyncBeaconFollowNodes = "syncbeaconfollower.followNodes"

	// CfgSyncBeaconMaxTimeWindowSec defines the maximum time window for which a sync payload would be considerable.
	CfgSyncBeaconMaxTimeWindowSec = "syncbeaconfollower.maxTimeWindowSec"

	// CfgSyncBeaconMaxTimeOfflineSec defines the maximum time a beacon node can stay without receiving updates.
	CfgSyncBeaconMaxTimeOfflineSec = "syncbeaconfollower.maxTimeOffline"

	// CfgSyncBeaconCleanupInterval defines the interval that old beacon status are cleaned up.
	CfgSyncBeaconCleanupInterval = "syncbeaconfollower.cleanupInterval"

	// CfgSyncBeaconSyncPercentage defines the percentage of following nodes that have to be synced.
	CfgSyncBeaconSyncPercentage = "syncbeaconfollower.syncPercentage"
)

Variables

View Source
var (

	// ErrMissingFollowNodes is returned if the node starts with no follow nodes list
	ErrMissingFollowNodes = errors.New("follow nodes list is required")
	// ErrNodeNotSynchronized is returned when an operation can't be executed because
	// the node is not synchronized.
	ErrNodeNotSynchronized = errors.New("node is not synchronized")
)

Functions

func MarkDesynced

func MarkDesynced()

MarkDesynced marks the node as desynced.

func MarkSynced

func MarkSynced()

MarkSynced marks the node as synced.

func OverwriteSyncedState

func OverwriteSyncedState(syncedOverwrite bool)

OverwriteSyncedState overwrites the synced state with the given value.

func Plugin

func Plugin() *node.Plugin

Plugin gets the plugin instance.

func SyncStatus

func SyncStatus() (bool, map[ed25519.PublicKey]Status)

SyncStatus returns the detailed status per beacon node.

func Synced

func Synced() bool

Synced tells whether the node is in a state we consider synchronized, meaning it has the relevant past and present message data. The synchronized state is defined by following a certain set of sync beacon nodes where for each of these beacons a message needs to become solid within bounded time.

Types

type Status

type Status struct {
	MsgID    tangle.MessageID
	SentTime int64
	Synced   bool
}

Status represents the status of a beacon node consisting of latest messageID, sentTime and sync status.

Jump to

Keyboard shortcuts

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