stateroot

package
v0.94.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Category is message category for extensible payloads.
	Category = "StateService"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Type    MessageType
	Payload io.Serializable
}

Message represents state-root related message.

func NewMessage

func NewMessage(typ MessageType, p io.Serializable) *Message

NewMessage creates new message of specified type.

func (*Message) DecodeBinary

func (m *Message) DecodeBinary(r *io.BinReader)

DecodeBinary implements io.Serializable interface.

func (*Message) EncodeBinary

func (m *Message) EncodeBinary(w *io.BinWriter)

EncodeBinary implements io.Serializable interface.

type MessageType

type MessageType byte

MessageType represents message type.

const (
	VoteT MessageType = 0
	RootT MessageType = 1
)

Various message types.

type RelayCallback

type RelayCallback = func(*payload.Extensible)

RelayCallback represents callback for sending validated state roots.

type Service

type Service interface {
	blockchainer.StateRoot
	OnPayload(p *payload.Extensible) error
	AddSignature(height uint32, validatorIndex int32, sig []byte) error
	GetConfig() config.StateRoot
	SetRelayCallback(RelayCallback)
	Run()
	Shutdown()
}

Service represents state root service.

func New

New returns new state root service instance using underlying module.

type Vote

type Vote struct {
	ValidatorIndex int32
	Height         uint32
	Signature      []byte
}

Vote represents vote message.

func (*Vote) DecodeBinary

func (p *Vote) DecodeBinary(r *io.BinReader)

DecodeBinary implements io.Serializable interface.

func (*Vote) EncodeBinary

func (p *Vote) EncodeBinary(w *io.BinWriter)

EncodeBinary implements io.Serializable interface.

Jump to

Keyboard shortcuts

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