tangle

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PLUGIN = node.NewPlugin("Tangle", node.Enabled, configure, run)

	ErrDatabaseRevalidationFailed = errors.New("Database revalidation failed! Please delete the database folder and start with a new local snapshot.")
)
View Source
var (
	ErrSnapshotInfoMissing                   = errors.New("snapshot information not found in database")
	ErrLatestMilestoneOlderThanSnapshotIndex = errors.New("latest milestone in the database is older than the snapshot index")
	ErrSnapshotIndexWrong                    = errors.New("snapshot index does not fit the snapshot ledger index")
)
View Source
var (
	ErrMilestoneNotFound = errors.New("milestone not found")
	ErrDivisionByZero    = errors.New("division by zero")
)
View Source
var Events = pluginEvents{
	ReceivedNewTransaction:        events.NewEvent(tangle.NewTransactionCaller),
	ReceivedKnownTransaction:      events.NewEvent(tangle.TransactionCaller),
	ProcessedTransaction:          events.NewEvent(tangle.TransactionHashCaller),
	TransactionSolid:              events.NewEvent(tangle.TransactionHashCaller),
	TransactionConfirmed:          events.NewEvent(tangle.TransactionConfirmedCaller),
	TransactionStored:             events.NewEvent(tangle.TransactionCaller),
	BundleSolid:                   events.NewEvent(tangle.BundleCaller),
	ReceivedNewMilestone:          events.NewEvent(tangle.BundleCaller),
	LatestMilestoneChanged:        events.NewEvent(tangle.BundleCaller),
	LatestMilestoneIndexChanged:   events.NewEvent(milestone.IndexCaller),
	MilestoneConfirmed:            events.NewEvent(ConfirmedMilestoneCaller),
	SolidMilestoneChanged:         events.NewEvent(tangle.BundleCaller),
	SolidMilestoneIndexChanged:    events.NewEvent(milestone.IndexCaller),
	SnapshotMilestoneIndexChanged: events.NewEvent(milestone.IndexCaller),
	PruningMilestoneIndexChanged:  events.NewEvent(milestone.IndexCaller),
	NewConfirmedMilestoneMetric:   events.NewEvent(NewConfirmedMilestoneMetricCaller),
	MilestoneSolidificationFailed: events.NewEvent(milestone.IndexCaller),
}

Functions

func ConfirmedMilestoneCaller

func ConfirmedMilestoneCaller(handler interface{}, params ...interface{})

func GetSolidifierMilestoneIndex

func GetSolidifierMilestoneIndex() milestone.Index

func IsNodeHealthy

func IsNodeHealthy() bool

IsNodeHealthy returns whether the node is synced, has active neighbors and its latest milestone is not too old.

func IsReceiveTxWorkerPoolBusy

func IsReceiveTxWorkerPoolBusy() bool

func NewConfirmedMilestoneMetricCaller

func NewConfirmedMilestoneMetricCaller(handler interface{}, params ...interface{})

func SetUpdateSyncedAtStartup

func SetUpdateSyncedAtStartup(updateSynced bool)

SetUpdateSyncedAtStartup sets the flag if the isNodeSynced status should be updated at startup

func TriggerSolidifier

func TriggerSolidifier()

TriggerSolidifier can be used to manually trigger the solidifier from other plugins.

Types

type ConfirmedMilestoneMetric

type ConfirmedMilestoneMetric struct {
	MilestoneIndex         milestone.Index `json:"ms_index"`
	TPS                    float64         `json:"tps"`
	CTPS                   float64         `json:"ctps"`
	ConfirmationRate       float64         `json:"conf_rate"`
	TimeSinceLastMilestone float64         `json:"time_since_last_ms"`
}

Jump to

Keyboard shortcuts

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