Documentation ¶
Index ¶
- Variables
- func WithBootstrapThreshold(threshold time.Duration) options.Option[Engine]
- func WithEntryPointsDepth(entryPointsDepth int) options.Option[Engine]
- func WithRequesterOptions(opts ...options.Option[eventticker.EventTicker[models.BlockID]]) options.Option[Engine]
- func WithSnapshotDepth(depth int) options.Option[Engine]
- func WithTSCManagerOptions(opts ...options.Option[tsc.Manager]) options.Option[Engine]
- type Engine
- func (e *Engine) Block(id models.BlockID) (block *models.Block, exists bool)
- func (e *Engine) Export(writer io.WriteSeeker, targetSlot slot.Index) (err error)
- func (e *Engine) FirstUnacceptedMarker(sequenceID markers.SequenceID) markers.Index
- func (e *Engine) Import(reader io.ReadSeeker) (err error)
- func (e *Engine) Initialize(snapshot ...string) (err error)
- func (e *Engine) IsBootstrapped() (isBootstrapped bool)
- func (e *Engine) IsSynced() (isBootstrapped bool)
- func (e *Engine) LastConfirmedSlot() slot.Index
- func (e *Engine) Name() string
- func (e *Engine) ProcessBlockFromPeer(block *models.Block, source identity.ID)
- func (e *Engine) RemoveFromFilesystem() error
- func (e *Engine) Shutdown()
- func (e *Engine) SlotTimeProvider() *slot.TimeProvider
- func (e *Engine) WriteSnapshot(filePath string, targetSlot ...slot.Index) (err error)
- type Events
- type TestFramework
- func (e *TestFramework) AssertRootBlocks(rootBlocks []*models.Block)
- func (e *TestFramework) AssertSlotState(index slot.Index)
- func (e *TestFramework) ExportBytes(export func(io.WriteSeeker, slot.Index) error, targetIndex slot.Index) []byte
- func (e *TestFramework) SlotTimeProvider() *slot.TimeProvider
- type WriteSeekerBuffer
Constants ¶
This section is empty.
Variables ¶
View Source
var NewEvents = event.CreateGroupConstructor(func() (newEvents *Events) { return &Events{ Error: event.New1[error](), BlockProcessed: event.New1[models.BlockID](), EvictionState: eviction.NewEvents(), Filter: filter.NewEvents(), Ledger: ledger.NewEvents(), Mesh: mesh.NewEvents(), Consensus: consensus.NewEvents(), Clock: clock.NewEvents(), Notarization: notarization.NewEvents(), BlockRequester: eventticker.NewEvents[models.BlockID](), } })
NewEvents contains the constructor of the Events object (it is generated by a generic factory).
Functions ¶
func WithBootstrapThreshold ¶
func WithRequesterOptions ¶
func WithRequesterOptions(opts ...options.Option[eventticker.EventTicker[models.BlockID]]) options.Option[Engine]
Types ¶
type Engine ¶
type Engine struct { Events *Events Storage *storage.Storage SybilProtection sybilprotection.SybilProtection ThroughputQuota throughputquota.ThroughputQuota Ledger ledger.Ledger Filter filter.Filter EvictionState *eviction.State BlockRequester *eventticker.EventTicker[models.BlockID] Notarization notarization.Notarization Mesh mesh.Mesh Consensus consensus.Consensus TSCManager *tsc.Manager Clock clock.Clock Workers *workerpool.Group ProcessingMutex sync.Mutex module.Module // contains filtered or unexported fields }
func New ¶
func New( workers *workerpool.Group, storageInstance *storage.Storage, clockProvider module.Provider[*Engine, clock.Clock], ledger module.Provider[*Engine, ledger.Ledger], filter module.Provider[*Engine, filter.Filter], sybilProtection module.Provider[*Engine, sybilprotection.SybilProtection], throughputQuota module.Provider[*Engine, throughputquota.ThroughputQuota], notarization module.Provider[*Engine, notarization.Notarization], mesh module.Provider[*Engine, mesh.Mesh], consensus module.Provider[*Engine, consensus.Consensus], opts ...options.Option[Engine], ) (engine *Engine)
func NewTestEngine ¶
func NewTestEngine(t *testing.T, workers *workerpool.Group, storage *storage.Storage, clock module.Provider[*Engine, clock.Clock], ledger module.Provider[*Engine, ledger.Ledger], filter module.Provider[*Engine, filter.Filter], sybilProtection module.Provider[*Engine, sybilprotection.SybilProtection], throughputQuota module.Provider[*Engine, throughputquota.ThroughputQuota], notarization module.Provider[*Engine, notarization.Notarization], mesh module.Provider[*Engine, mesh.Mesh], consensus module.Provider[*Engine, consensus.Consensus], opts ...options.Option[Engine], ) *Engine
func (*Engine) FirstUnacceptedMarker ¶
func (e *Engine) FirstUnacceptedMarker(sequenceID markers.SequenceID) markers.Index
func (*Engine) Initialize ¶
func (*Engine) IsBootstrapped ¶
func (*Engine) LastConfirmedSlot ¶
func (*Engine) ProcessBlockFromPeer ¶
func (*Engine) RemoveFromFilesystem ¶
RemoveFromFilesystem removes the directory of the engine from the filesystem.
func (*Engine) SlotTimeProvider ¶
func (e *Engine) SlotTimeProvider() *slot.TimeProvider
type Events ¶
type Events struct { Error *event.Event1[error] BlockProcessed *event.Event1[models.BlockID] EvictionState *eviction.Events Filter *filter.Events Ledger *ledger.Events Mesh *mesh.Events Consensus *consensus.Events Clock *clock.Events Notarization *notarization.Events BlockRequester *eventticker.Events[models.BlockID] event.Group[Events, *Events] }
type TestFramework ¶
type TestFramework struct { Instance *Engine Mesh *mesh.TestFramework Booker *booker.TestFramework BlockDAG *blockdag.TestFramework MemPool *mempool.TestFramework VirtualVoting *booker.VirtualVotingTestFramework Acceptance *blockgadget.TestFramework // contains filtered or unexported fields }
func NewDefaultTestFramework ¶
func NewDefaultTestFramework(t *testing.T, workers *workerpool.Group, clock module.Provider[*Engine, clock.Clock], ledger module.Provider[*Engine, ledger.Ledger], filter module.Provider[*Engine, filter.Filter], sybilProtection module.Provider[*Engine, sybilprotection.SybilProtection], throughputQuota module.Provider[*Engine, throughputquota.ThroughputQuota], notarization module.Provider[*Engine, notarization.Notarization], mesh module.Provider[*Engine, mesh.Mesh], consensus module.Provider[*Engine, consensus.Consensus], optsEngine ...options.Option[Engine], ) *TestFramework
func NewTestFramework ¶
func NewTestFramework(test *testing.T, workers *workerpool.Group, engine *Engine) *TestFramework
func (*TestFramework) AssertRootBlocks ¶
func (e *TestFramework) AssertRootBlocks(rootBlocks []*models.Block)
func (*TestFramework) AssertSlotState ¶
func (e *TestFramework) AssertSlotState(index slot.Index)
func (*TestFramework) ExportBytes ¶
func (e *TestFramework) ExportBytes(export func(io.WriteSeeker, slot.Index) error, targetIndex slot.Index) []byte
func (*TestFramework) SlotTimeProvider ¶
func (e *TestFramework) SlotTimeProvider() *slot.TimeProvider
type WriteSeekerBuffer ¶
Click to show internal directories.
Click to hide internal directories.