protocol

package
v2.0.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SupportedVersions = Versions{2} // make sure to add the versions sorted asc
)

Functions

This section is empty.

Types

type Events

type Events struct {
	// Emits a protocol parameters milestone option for the unsupported milestone one milestone before.
	NextMilestoneUnsupported *events.Event
	// Emits critical errors.
	CriticalErrors *events.Event
}

Events are events happening around the Manager.

type Manager

type Manager struct {
	// Events holds the events happening within the Manager.
	Events *Events
	// contains filtered or unexported fields
}

Manager handles the knowledge about current, pending and supported protocol versions and parameters.

func NewManager

func NewManager(storage *storage.Storage, ledgerIndex iotago.MilestoneIndex) (*Manager, error)

NewManager creates a new Manager.

func (*Manager) Current

func (m *Manager) Current() *iotago.ProtocolParameters

Current returns the current protocol parameters under which the node is operating.

func (*Manager) HandleConfirmedMilestone

func (m *Manager) HandleConfirmedMilestone(cachedMilestone *storage.CachedMilestone)

HandleConfirmedMilestone examines the newly confirmed milestone for protocol parameter changes.

func (*Manager) NextPendingSupported

func (m *Manager) NextPendingSupported() bool

NextPendingSupported tells whether the next pending protocol parameters changes are supported.

func (*Manager) Pending

func (m *Manager) Pending() []*iotago.ProtocolParamsMilestoneOpt

Pending returns the currently pending protocol changes.

func (*Manager) SupportedVersions

func (m *Manager) SupportedVersions() Versions

SupportedVersions returns a slice of supported protocol versions.

type Versions

type Versions []uint32

Versions is a slice of protocol versions.

func (Versions) Highest

func (v Versions) Highest() byte

Highest returns the highest version.

func (Versions) Lowest

func (v Versions) Lowest() byte

Lowest returns the lowest version.

func (Versions) Supports

func (v Versions) Supports(ver byte) bool

Supports tells whether the given version is supported.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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