Documentation ¶
Index ¶
- Constants
- Variables
- func WithBaseDirectory(baseDirectory string) options.Option[Protocol]
- func WithChainManagerOptions(opts ...options.Option[chainmanager.Manager]) options.Option[Protocol]
- func WithCongestionControlOptions(opts ...options.Option[congestioncontrol.CongestionControl]) options.Option[Protocol]
- func WithConsensusProvider(consensusProvider module.Provider[*engine.Engine, consensus.Consensus]) options.Option[Protocol]
- func WithEngineOptions(opts ...options.Option[engine.Engine]) options.Option[Protocol]
- func WithFilterProvider(optsFilterProvider module.Provider[*engine.Engine, filter.Filter]) options.Option[Protocol]
- func WithLedgerProvider(optsLedgerProvider module.Provider[*engine.Engine, ledger.Ledger]) options.Option[Protocol]
- func WithMeshProvider(meshProvider module.Provider[*engine.Engine, mesh.Mesh]) options.Option[Protocol]
- func WithNotarizationProvider(...) options.Option[Protocol]
- func WithProtocolOptions(opts ...options.Option[Protocol]) options.Option[TestFramework]
- func WithPruningThreshold(pruningThreshold uint64) options.Option[Protocol]
- func WithSnapshotPath(snapshot string) options.Option[Protocol]
- func WithStorageDatabaseManagerOptions(opts ...options.Option[database.Manager]) options.Option[Protocol]
- func WithSybilProtectionProvider(...) options.Option[Protocol]
- func WithThroughputQuotaProvider(...) options.Option[Protocol]
- func WithTipManagerOptions(opts ...options.Option[tipmanager.TipManager]) options.Option[Protocol]
- type Events
- type Protocol
- func (p *Protocol) CandidateEngineInstance() (instance *engine.Engine)
- func (p *Protocol) ChainManager() (instance *chainmanager.Manager)
- func (p *Protocol) Engine() *engine.Engine
- func (p *Protocol) MainEngineInstance() *engine.Engine
- func (p *Protocol) Network() *network.Protocol
- func (p *Protocol) ProcessAttestations(forkingPoint *commitment.Commitment, blockIDs models.BlockIDs, ...)
- func (p *Protocol) ProcessAttestationsRequest(forkingPoint *commitment.Commitment, endIndex slot.Index, src identity.ID)
- func (p *Protocol) ProcessBlock(block *models.Block, src identity.ID) error
- func (p *Protocol) Run()
- func (p *Protocol) Shutdown()
- func (p *Protocol) SlotTimeProvider() *slot.TimeProvider
- type TestFramework
Constants ¶
View Source
const DatabaseVersion database.Version = 1
Variables ¶
View Source
var NewEvents = event.CreateGroupConstructor(func() (newEvents *Events) { return &Events{ InvalidBlockReceived: event.New1[identity.ID](), CandidateEngineActivated: event.New1[*engine.Engine](), MainEngineSwitched: event.New1[*engine.Engine](), Error: event.New1[error](), Network: network.NewEvents(), Engine: engine.NewEvents(), CongestionControl: congestioncontrol.NewEvents(), TipManager: tipmanager.NewEvents(), ChainManager: chainmanager.NewEvents(), } })
Functions ¶
func WithChainManagerOptions ¶
func WithCongestionControlOptions ¶
func WithCongestionControlOptions(opts ...options.Option[congestioncontrol.CongestionControl]) options.Option[Protocol]
func WithConsensusProvider ¶
func WithEngineOptions ¶
func WithFilterProvider ¶
func WithLedgerProvider ¶
func WithMeshProvider ¶
func WithNotarizationProvider ¶
func WithNotarizationProvider(notarizationProvider module.Provider[*engine.Engine, notarization.Notarization]) options.Option[Protocol]
func WithProtocolOptions ¶
func WithPruningThreshold ¶
func WithSybilProtectionProvider ¶
func WithSybilProtectionProvider(sybilProtectionProvider module.Provider[*engine.Engine, sybilprotection.SybilProtection]) options.Option[Protocol]
func WithThroughputQuotaProvider ¶
func WithThroughputQuotaProvider(throughputQuotaProvider module.Provider[*engine.Engine, throughputquota.ThroughputQuota]) options.Option[Protocol]
func WithTipManagerOptions ¶
func WithTipManagerOptions(opts ...options.Option[tipmanager.TipManager]) options.Option[Protocol]
Types ¶
type Events ¶
type Events struct { InvalidBlockReceived *event.Event1[identity.ID] CandidateEngineActivated *event.Event1[*engine.Engine] MainEngineSwitched *event.Event1[*engine.Engine] Error *event.Event1[error] Network *network.Events Engine *engine.Events CongestionControl *congestioncontrol.Events TipManager *tipmanager.Events ChainManager *chainmanager.Events event.Group[Events, *Events] }
type Protocol ¶
type Protocol struct { Events *Events CongestionControl *congestioncontrol.CongestionControl TipManager *tipmanager.TipManager Workers *workerpool.Group // contains filtered or unexported fields }
func (*Protocol) CandidateEngineInstance ¶
func (*Protocol) ChainManager ¶
func (p *Protocol) ChainManager() (instance *chainmanager.Manager)
func (*Protocol) MainEngineInstance ¶
func (*Protocol) ProcessAttestations ¶
func (p *Protocol) ProcessAttestations(forkingPoint *commitment.Commitment, blockIDs models.BlockIDs, attestations *orderedmap.OrderedMap[slot.Index, *advancedset.AdvancedSet[*notarization.Attestation]], source identity.ID)
func (*Protocol) ProcessAttestationsRequest ¶
func (p *Protocol) ProcessAttestationsRequest(forkingPoint *commitment.Commitment, endIndex slot.Index, src identity.ID)
func (*Protocol) ProcessBlock ¶
func (*Protocol) SlotTimeProvider ¶
func (p *Protocol) SlotTimeProvider() *slot.TimeProvider
type TestFramework ¶
type TestFramework struct { Network *network.MockedNetwork Instance *Protocol Local *identity.Identity Engine *engine.TestFramework // contains filtered or unexported fields }
func NewTestFramework ¶
func NewTestFramework(test *testing.T, workers *workerpool.Group, ledgerVM vm.VM, opts ...options.Option[TestFramework]) *TestFramework
Click to show internal directories.
Click to hide internal directories.