netmap

package
v0.38.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AddPeerNotaryEvent is method name for netmap `addPeer` operation
	// in `Netmap` contract. Is used as identificator for notary
	// peer addition requests.
	AddPeerNotaryEvent = "addPeer"
)
View Source
const (
	// UpdateStateNotaryEvent is method name for netmap state updating
	// operations in `Netmap` contract. Is used as identificator for
	// notary delete container requests.
	UpdateStateNotaryEvent = "updateState"
)

Variables

This section is empty.

Functions

func ParseAddPeerNotary

func ParseAddPeerNotary(ne event.NotaryEvent) (event.Event, error)

ParseAddPeerNotary from NotaryEvent into netmap event structure.

func ParseNewEpoch

func ParseNewEpoch(e *state.ContainedNotificationEvent) (event.Event, error)

ParseNewEpoch is a parser of new epoch notification event.

Result is type of NewEpoch.

func ParseUpdatePeerNotary

func ParseUpdatePeerNotary(ne event.NotaryEvent) (event.Event, error)

ParseUpdatePeerNotary from NotaryEvent into netmap event structure.

Types

type AddPeer

type AddPeer struct {
	NodeBytes []byte

	// For notary notifications only.
	// Contains raw transactions of notary request.
	Request *payload.P2PNotaryRequest
}

func (AddPeer) MorphEvent

func (AddPeer) MorphEvent()

MorphEvent implements Neo:Morph Event interface.

func (AddPeer) Node

func (s AddPeer) Node() []byte

func (AddPeer) NotaryRequest

func (s AddPeer) NotaryRequest() *payload.P2PNotaryRequest

NotaryRequest returns raw notary request if notification was received via notary service. Otherwise, returns nil.

type NewEpoch

type NewEpoch struct {
	Num uint64

	// Hash is used in notary environmental
	// for calculating unique but same for
	// all notification receivers values.
	Hash util.Uint256
}

NewEpoch is a new epoch Neo:Morph event.

func (NewEpoch) EpochNumber

func (s NewEpoch) EpochNumber() uint64

EpochNumber returns new epoch number.

func (NewEpoch) MorphEvent

func (NewEpoch) MorphEvent()

MorphEvent implements Neo:Morph Event interface.

func (NewEpoch) TxHash

func (s NewEpoch) TxHash() util.Uint256

TxHash returns hash of the TX with new epoch notification.

type UpdatePeer

type UpdatePeer struct {
	PubKey *keys.PublicKey

	State netmap.NodeState

	// For notary notifications only.
	// Contains raw transactions of notary request.
	Request *payload.P2PNotaryRequest
}

func (UpdatePeer) Maintenance

func (s UpdatePeer) Maintenance() bool

Maintenance returns true if node's state is requested to be switched to "maintenance".

func (UpdatePeer) MorphEvent

func (UpdatePeer) MorphEvent()

MorphEvent implements Neo:Morph Event interface.

func (UpdatePeer) NotaryRequest

func (s UpdatePeer) NotaryRequest() *payload.P2PNotaryRequest

NotaryRequest returns raw notary request if notification was received via notary service. Otherwise, returns nil.

func (UpdatePeer) Online

func (s UpdatePeer) Online() bool

Online returns true if node's state is requested to be switched to "online".

func (UpdatePeer) PublicKey

func (s UpdatePeer) PublicKey() *keys.PublicKey

Jump to

Keyboard shortcuts

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