Documentation
¶
Index ¶
Constants ¶
View Source
const ( GetAcceptedFrontier = router.GetAcceptedFrontier AcceptedFrontier = router.AcceptedFrontier GetAccepted = router.GetAccepted Accepted = router.Accepted Get = router.Get Put = router.Put PushQuery = router.PushQuery PullQuery = router.PullQuery Chits = router.Chits )
Op constants re-exported from core/router
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 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 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.