tangle

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeartbeatSentInterval   = 30 * time.Second
	HeartbeatReceiveTimeout = 100 * time.Second
)

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 added in v0.5.0

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

func GetSolidifierMilestoneIndex

func GetSolidifierMilestoneIndex() milestone.Index

func IsNodeHealthy added in v0.4.0

func IsNodeHealthy() bool

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

func IsReceiveTxWorkerPoolBusy added in v0.4.0

func IsReceiveTxWorkerPoolBusy() bool

func NewConfirmedMilestoneMetricCaller added in v0.4.0

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

func SetUpdateSyncedAtStartup added in v0.4.0

func SetUpdateSyncedAtStartup(updateSynced bool)

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

func TriggerSolidifier added in v0.4.0

func TriggerSolidifier()

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

func WaitForTangleProcessorStartup added in v0.5.4

func WaitForTangleProcessorStartup()

WaitForTangleProcessorStartup waits until all background workers of the tangle processor are started.

Types

type ConfirmedMilestoneMetric added in v0.4.0

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