@proto-kit/sequencer • Docs
Documentation / @proto-kit/sequencer / BatchProducerModule
Class: BatchProducerModule
The BatchProducerModule has the resposiblity to oversee the block production and combine all necessary parts for that to happen. The flow roughly follows the following steps:
- BlockTrigger triggers and executes the startup function
Extends
Constructors
new BatchProducerModule()
new BatchProducerModule(
leafStore,merkleStore,batchStorage,database,batchFlow,blockProofSerializer,batchTraceService):BatchProducerModule
Parameters
• leafStore: AsyncLinkedLeafStore
• merkleStore: AsyncMerkleTreeStore
• batchStorage: BatchStorage
• database: Database
• batchFlow: BatchFlow
• blockProofSerializer: BlockProofSerializer
• batchTraceService: BatchTracingService
Returns
Overrides
Defined in
packages/sequencer/src/protocol/production/BatchProducerModule.ts:49
Properties
currentConfig
protectedcurrentConfig:undefined|NoConfig
Store the config separately, so that we can apply additional checks when retrieving it via the getter
Inherited from
Defined in
packages/common/dist/config/ConfigurableModule.d.ts:17
presets
staticpresets:Presets<unknown> ={}
Inherited from
Defined in
packages/sequencer/src/sequencer/builder/SequencerModule.ts:20
Accessors
config
Get Signature
get config():
Config
Returns
Config
Set Signature
set config(
config):void
Parameters
• config: Config
Returns
void
Inherited from
Defined in
packages/common/dist/config/ConfigurableModule.d.ts:18
Methods
create()
create(
childContainerProvider):void
Parameters
• childContainerProvider: ChildContainerProvider
Returns
void
Inherited from
Defined in
packages/common/dist/config/ConfigurableModule.d.ts:20
createBatch()
createBatch(
blocks):Promise<undefined|SettleableBatch>
Main function to call when wanting to create a new block based on the transactions that are present in the mempool. This function should also be the one called by BlockTriggers.
Parameters
• blocks: BlockWithResult[]
Returns
Promise<undefined | SettleableBatch>
Defined in
packages/sequencer/src/protocol/production/BatchProducerModule.ts:70
start()
start():
Promise<void>
Start the module and all it’s functionality. The returned Promise has to resolve after initialization, since it will block in the sequencer init. That means that you mustn’t await server.start() for example.
Returns
Promise<void>
Overrides
Defined in
packages/sequencer/src/protocol/production/BatchProducerModule.ts:100