Documentation
¶
Index ¶
- Variables
- func WithBlockRequesterOptions(...) options.Option[Engine]
- func WithCommitmentCheck(checkCommitment bool) options.Option[Engine]
- func WithEntryPointsDepth(entryPointsDepth int) options.Option[Engine]
- func WithSnapshotDepth(depth int) options.Option[Engine]
- func WithSnapshotPath(snapshotPath string) options.Option[Engine]
- type CommitmentAPI
- func (c *CommitmentAPI) Attestations() (commitment *model.Commitment, attestations []*iotago.Attestation, ...)
- func (c *CommitmentAPI) BlocksIDsBySlotCommitmentID() (map[iotago.CommitmentID]iotago.BlockIDs, error)
- func (c *CommitmentAPI) Commitment() (commitment *model.Commitment, err error)
- func (c *CommitmentAPI) Mutations() (acceptedBlocksBySlotCommitment map[iotago.CommitmentID]iotago.BlockIDs, ...)
- func (c *CommitmentAPI) Roots() (committedRoots *iotago.Roots, err error)
- func (c *CommitmentAPI) TransactionIDs() (iotago.TransactionIDs, error)
- type Engine
- func (e *Engine) APIForEpoch(epoch iotago.EpochIndex) iotago.API
- func (e *Engine) APIForSlot(slot iotago.SlotIndex) iotago.API
- func (e *Engine) APIForTime(t time.Time) iotago.API
- func (e *Engine) APIForVersion(version iotago.Version) (iotago.API, error)
- func (e *Engine) Block(id iotago.BlockID) (*model.Block, bool)
- func (e *Engine) BlockFromCache(id iotago.BlockID) (*blocks.Block, bool)
- func (e *Engine) ChainID() iotago.CommitmentID
- func (e *Engine) CommitmentAPI(commitmentID iotago.CommitmentID) (*CommitmentAPI, error)
- func (e *Engine) CommittedAPI() iotago.API
- func (e *Engine) ErrorHandler(componentName string) func(error)
- func (e *Engine) Export(writer io.WriteSeeker, targetSlot iotago.SlotIndex) (err error)
- func (e *Engine) ExportSnapshot(filePath string, addSlotToFileName bool, useFinalized bool) (iotago.SlotIndex, string, error)
- func (e *Engine) ImportContents(reader io.ReadSeeker) (err error)
- func (e *Engine) ImportSettings(reader io.ReadSeeker) (err error)
- func (e *Engine) Inspect(session ...inspection.Session) inspection.InspectedObject
- func (e *Engine) IsSnapshotting() bool
- func (e *Engine) LatestAPI() iotago.API
- func (e *Engine) Name() string
- func (e *Engine) ProcessBlockFromPeer(block *model.Block, source peer.ID)
- func (e *Engine) RemoveFromFilesystem() error
- func (e *Engine) Reset()
- func (e *Engine) SetChainID(chainID iotago.CommitmentID)
- func (e *Engine) WriteSnapshot(filePath string, targetSlot ...iotago.SlotIndex) error
- type Events
Constants ¶
This section is empty.
Variables ¶
var (
ErrSnapshottingInProgress = ierrors.New("snapshotting is already in progress")
)
var NewEvents = event.CreateGroupConstructor(func() (newEvents *Events) { return &Events{ BlockProcessed: event.New1[iotago.BlockID](), AcceptedBlockProcessed: event.New1[*blocks.Block](), Evict: event.New1[iotago.SlotIndex](), PreSolidFilter: presolidfilter.NewEvents(), PostSolidFilter: postsolidfilter.NewEvents(), BlockRequester: eventticker.NewEvents[iotago.SlotIndex, iotago.BlockID](), TipManager: tipmanager.NewEvents(), BlockDAG: blockdag.NewEvents(), Booker: booker.NewEvents(), Clock: clock.NewEvents(), BlockGadget: blockgadget.NewEvents(), SlotGadget: slotgadget.NewEvents(), SybilProtection: sybilprotection.NewEvents(), Ledger: ledger.NewEvents(), Notarization: notarization.NewEvents(), SpendDAG: spenddag.NewEvents[iotago.TransactionID, mempool.StateID](), Scheduler: scheduler.NewEvents(), SeatManager: seatmanager.NewEvents(), SyncManager: syncmanager.NewEvents(), BlockRetainer: retainer.NewBlockRetainerEvents(), TransactionRetainer: retainer.NewTransactionRetainerEvents(), } })
NewEvents contains the constructor of the Events object (it is generated by a generic factory).
Functions ¶
Types ¶
type CommitmentAPI ¶
type CommitmentAPI struct {
// CommitmentID is the index of the slot that is accessed.
CommitmentID iotago.CommitmentID
// contains filtered or unexported fields
}
CommitmentAPI is a wrapper for the Engine that provides access to the data of a committed slot.
func NewCommitmentAPI ¶
func NewCommitmentAPI(engine *Engine, commitmentID iotago.CommitmentID) *CommitmentAPI
NewCommitmentAPI creates a new CommitmentAPI.
func (*CommitmentAPI) Attestations ¶
func (c *CommitmentAPI) Attestations() (commitment *model.Commitment, attestations []*iotago.Attestation, merkleProof *merklehasher.Proof[iotago.Identifier], err error)
Attestations returns the commitment, attestations and the merkle proof of the slot.
func (*CommitmentAPI) BlocksIDsBySlotCommitmentID ¶
func (c *CommitmentAPI) BlocksIDsBySlotCommitmentID() (map[iotago.CommitmentID]iotago.BlockIDs, error)
BlocksIDsBySlotCommitmentID returns the accepted block IDs of the slot grouped by their SlotCommitmentID.
func (*CommitmentAPI) Commitment ¶
func (c *CommitmentAPI) Commitment() (commitment *model.Commitment, err error)
Commitment returns the commitment of the slot.
func (*CommitmentAPI) Mutations ¶
func (c *CommitmentAPI) Mutations() (acceptedBlocksBySlotCommitment map[iotago.CommitmentID]iotago.BlockIDs, acceptedBlocksProof *merklehasher.Proof[iotago.Identifier], acceptedTransactionIDs iotago.TransactionIDs, acceptedTransactionsProof *merklehasher.Proof[iotago.Identifier], err error)
Mutations returns all accepted block IDs, the tangle proof, all accepted transaction IDs and the ledger state mutation proof of the slot.
func (*CommitmentAPI) Roots ¶
func (c *CommitmentAPI) Roots() (committedRoots *iotago.Roots, err error)
Roots returns the roots of the slot.
func (*CommitmentAPI) TransactionIDs ¶
func (c *CommitmentAPI) TransactionIDs() (iotago.TransactionIDs, error)
type Engine ¶
type Engine struct {
Events *Events
Storage *storage.Storage
PreSolidFilter presolidfilter.PreSolidFilter
PostSolidFilter postsolidfilter.PostSolidFilter
EvictionState *eviction.State
BlockRequester *eventticker.EventTicker[iotago.SlotIndex, iotago.BlockID]
BlockDAG blockdag.BlockDAG
Booker booker.Booker
Clock clock.Clock
BlockGadget blockgadget.Gadget
SlotGadget slotgadget.Gadget
SybilProtection sybilprotection.SybilProtection
Notarization notarization.Notarization
SyncManager syncmanager.SyncManager
Attestations attestation.Attestations
Ledger ledger.Ledger
Scheduler scheduler.Scheduler
TipManager tipmanager.TipManager
TipSelection tipselection.TipSelection
BlockRetainer retainer.BlockRetainer
TxRetainer retainer.TransactionRetainer
UpgradeOrchestrator upgrade.Orchestrator
// RootCommitment contains the earliest commitment that blocks we are solidifying will refer to, and is mainly
// used to determine the cut-off point for the actively managed commitments in the protocol.
RootCommitment reactive.Variable[*model.Commitment]
// LatestCommitment contains the latest commitment that we have produced.
LatestCommitment reactive.Variable[*model.Commitment]
Workers *workerpool.Group
BlockCache *blocks.Blocks
module.Module
// contains filtered or unexported fields
}
func New ¶
func New( logger log.Logger, workers *workerpool.Group, storageInstance *storage.Storage, preSolidFilterProvider module.Provider[*Engine, presolidfilter.PreSolidFilter], postSolidFilterProvider module.Provider[*Engine, postsolidfilter.PostSolidFilter], blockDAGProvider module.Provider[*Engine, blockdag.BlockDAG], bookerProvider module.Provider[*Engine, booker.Booker], clockProvider module.Provider[*Engine, clock.Clock], blockGadgetProvider module.Provider[*Engine, blockgadget.Gadget], slotGadgetProvider module.Provider[*Engine, slotgadget.Gadget], sybilProtectionProvider module.Provider[*Engine, sybilprotection.SybilProtection], notarizationProvider module.Provider[*Engine, notarization.Notarization], syncManagerProvider module.Provider[*Engine, syncmanager.SyncManager], attestationProvider module.Provider[*Engine, attestation.Attestations], ledgerProvider module.Provider[*Engine, ledger.Ledger], schedulerProvider module.Provider[*Engine, scheduler.Scheduler], tipManagerProvider module.Provider[*Engine, tipmanager.TipManager], tipSelectionProvider module.Provider[*Engine, tipselection.TipSelection], blockRetainerProvider module.Provider[*Engine, retainer.BlockRetainer], txRetainerProvider module.Provider[*Engine, retainer.TransactionRetainer], upgradeOrchestratorProvider module.Provider[*Engine, upgrade.Orchestrator], opts ...options.Option[Engine], ) (engine *Engine)
func (*Engine) APIForEpoch ¶
func (e *Engine) APIForEpoch(epoch iotago.EpochIndex) iotago.API
func (*Engine) APIForVersion ¶
func (*Engine) BlockFromCache ¶
func (*Engine) ChainID ¶
func (e *Engine) ChainID() iotago.CommitmentID
func (*Engine) CommitmentAPI ¶
func (e *Engine) CommitmentAPI(commitmentID iotago.CommitmentID) (*CommitmentAPI, error)
CommitmentAPI returns the committed slot for the given slot index.
func (*Engine) CommittedAPI ¶
func (*Engine) ErrorHandler ¶
func (*Engine) ExportSnapshot ¶
func (*Engine) ImportContents ¶
func (e *Engine) ImportContents(reader io.ReadSeeker) (err error)
func (*Engine) ImportSettings ¶
func (e *Engine) ImportSettings(reader io.ReadSeeker) (err error)
func (*Engine) Inspect ¶
func (e *Engine) Inspect(session ...inspection.Session) inspection.InspectedObject
Inspect inspects the Engine and its subcomponents.
func (*Engine) IsSnapshotting ¶
func (*Engine) ProcessBlockFromPeer ¶
func (*Engine) RemoveFromFilesystem ¶
RemoveFromFilesystem removes the directory of the engine from the filesystem.
func (*Engine) Reset ¶
func (e *Engine) Reset()
Reset resets the component to a clean state as if it was created at the last commitment.
func (*Engine) SetChainID ¶
func (e *Engine) SetChainID(chainID iotago.CommitmentID)
type Events ¶
type Events struct {
BlockProcessed *event.Event1[iotago.BlockID]
AcceptedBlockProcessed *event.Event1[*blocks.Block]
Evict *event.Event1[iotago.SlotIndex]
PreSolidFilter *presolidfilter.Events
PostSolidFilter *postsolidfilter.Events
BlockRequester *eventticker.Events[iotago.SlotIndex, iotago.BlockID]
TipManager *tipmanager.Events
BlockDAG *blockdag.Events
Booker *booker.Events
Clock *clock.Events
BlockGadget *blockgadget.Events
SlotGadget *slotgadget.Events
SybilProtection *sybilprotection.Events
Ledger *ledger.Events
Notarization *notarization.Events
SpendDAG *spenddag.Events[iotago.TransactionID, mempool.StateID]
Scheduler *scheduler.Events
SeatManager *seatmanager.Events
SyncManager *syncmanager.Events
BlockRetainer *retainer.BlockRetainerEvents
TransactionRetainer *retainer.TransactionRetainerEvents
event.Group[Events, *Events]
}