Documentation ¶
Index ¶
Constants ¶
View Source
const (
// Category is a message category for extensible payloads.
Category = "StateService"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ledger ¶ added in v0.98.1
type Ledger interface { GetConfig() config.Blockchain GetDesignatedByRole(role noderoles.Role) (keys.PublicKeys, uint32, error) HeaderHeight() uint32 SubscribeForBlocks(ch chan *block.Block) UnsubscribeFromBlocks(ch chan *block.Block) }
Ledger is an interface to Blockchain sufficient for Service.
type Message ¶
type Message struct { Type MessageType Payload io.Serializable }
Message represents a state-root related message.
func NewMessage ¶
func NewMessage(typ MessageType, p io.Serializable) *Message
NewMessage creates a new message of the specified type.
func (*Message) DecodeBinary ¶
DecodeBinary implements the io.Serializable interface.
func (*Message) EncodeBinary ¶
EncodeBinary implements the 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 { Name() string OnPayload(p *payload.Extensible) error AddSignature(height uint32, validatorIndex int32, sig []byte) error GetConfig() config.StateRoot // Start runs service instance in a separate goroutine. // The service only starts once, subsequent calls to Start are no-op. Start() // Shutdown stops the service. It can only be called once, subsequent calls // to Shutdown on the same instance are no-op. The instance that was stopped can // not be started again by calling Start (use a new instance if needed). Shutdown() // IsAuthorized returns whether state root service currently is authorized to sign // state roots. It returns true iff designated StateValidator node's account // provided to the state root service in decrypted state. IsAuthorized() bool }
Service represents a state root service.
type Vote ¶
Vote represents a vote message.
func (*Vote) DecodeBinary ¶
DecodeBinary implements the io.Serializable interface.
func (*Vote) EncodeBinary ¶
EncodeBinary implements the io.Serializable interface.
Click to show internal directories.
Click to hide internal directories.