Documentation
¶
Index ¶
Constants ¶
View Source
const ( PendingTxs = core.PendingTxs StateSyncDone = core.StateSyncDone )
Message type constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface {
// HandleInbound handles inbound messages
HandleInbound(context.Context, Message) error
// HandleOutbound handles outbound messages
HandleOutbound(context.Context, Message) error
// Connected handles node connection
Connected(context.Context, ids.NodeID) error
// Disconnected handles node disconnection
Disconnected(context.Context, ids.NodeID) error
}
Handler handles network messages
type MessageType ¶ added in v1.22.3
type MessageType = core.MessageType
Re-export core types for convenience
type NotificationForwarder ¶ added in v1.22.3
type NotificationForwarder struct {
Engine Notifier
Subscribe Subscription
Log log.Logger
// contains filtered or unexported fields
}
NotificationForwarder forwards VM notifications to the consensus engine
func NewNotificationForwarder ¶ added in v1.22.3
func NewNotificationForwarder(engine Notifier, subscribe Subscription, logger log.Logger) *NotificationForwarder
NewNotificationForwarder creates a new NotificationForwarder
func (*NotificationForwarder) CheckForEvent ¶ added in v1.22.3
func (nf *NotificationForwarder) CheckForEvent()
CheckForEvent triggers a new subscription if the forwarder is waiting This should be called when the VM state changes (e.g., after SetPreference, BuildBlock)
func (*NotificationForwarder) Start ¶ added in v1.22.3
func (nf *NotificationForwarder) Start()
Start begins the notification forwarding loop
func (*NotificationForwarder) Stop ¶ added in v1.22.3
func (nf *NotificationForwarder) Stop()
Stop stops the notification forwarding loop
type Notifier ¶ added in v1.22.3
type Notifier interface {
// Notify is called when the VM has a message for the consensus engine
Notify(context.Context, VMMessage) error
}
Notifier is the interface for receiving VM notifications
type Op ¶
type Op byte
Op represents an operation
const ( // GetAcceptedFrontier gets accepted frontier GetAcceptedFrontier Op = iota // AcceptedFrontier is accepted frontier response AcceptedFrontier // GetAccepted gets accepted GetAccepted // Accepted is accepted response Accepted // Get gets an item Get // Put puts an item Put // PushQuery pushes a query PushQuery // PullQuery pulls a query PullQuery // Chits is chits response Chits )
type Subscription ¶ added in v1.22.3
Subscription is a function that waits for VM events
Click to show internal directories.
Click to hide internal directories.