Documentation
¶
Index ¶
- Variables
- type BlockHandler
- func (i *BlockHandler) AttachBlock(ctx context.Context, iotaBlock *iotago.Block) (iotago.BlockID, error)
- func (i *BlockHandler) Shutdown()
- func (i *BlockHandler) SubmitBlock(block *model.Block) error
- func (i *BlockHandler) SubmitBlockAndAwaitEvent(ctx context.Context, block *model.Block, evt *event.Event1[*blocks.Block]) error
- type Events
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBlockAttacherInvalidBlock = ierrors.New("invalid block") ErrBlockAttacherAttachingNotPossible = ierrors.New("attaching not possible") ErrBlockAttacherIncompleteBlockNotAllowed = ierrors.New("incomplete block is not allowed on this node") )
View Source
var NewEvents = event.CreateGroupConstructor(func() (newEvents *Events) { return &Events{ BlockSubmitted: event.New1[*model.Block](), Error: event.New1[error](), } })
NewEvents contains the constructor of the Events object (it is generated by a generic factory).
Functions ¶
This section is empty.
Types ¶
type BlockHandler ¶
type BlockHandler struct {
// contains filtered or unexported fields
}
BlockHandler contains the logic to attach blocks to the Tangle and await for it to be processed.
func New ¶
func New(p *protocol.Protocol) *BlockHandler
func (*BlockHandler) AttachBlock ¶
func (*BlockHandler) Shutdown ¶
func (i *BlockHandler) Shutdown()
Shutdown shuts down the block issuer.
func (*BlockHandler) SubmitBlock ¶
func (i *BlockHandler) SubmitBlock(block *model.Block) error
SubmitBlock submits a block to be processed.
type Events ¶
type Events struct { // Triggered when a block is submitted, i.e. sent to the protocol to be processed. BlockSubmitted *event.Event1[*model.Block] // Fired when an error occurred. Error *event.Event1[error] event.Group[Events, *Events] }
Events represents events happening on a block factory.
Click to show internal directories.
Click to hide internal directories.