@proto-kit/sequencerDocs


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:

  1. 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

BatchProducerModule

Overrides

SequencerModule.constructor

Defined in

packages/sequencer/src/protocol/production/BatchProducerModule.ts:49

Properties

currentConfig

protected currentConfig: undefined | NoConfig

Store the config separately, so that we can apply additional checks when retrieving it via the getter

Inherited from

SequencerModule.currentConfig

Defined in

packages/common/dist/config/ConfigurableModule.d.ts:17


presets

static presets: Presets<unknown> = {}

Inherited from

SequencerModule.presets

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

SequencerModule.config

Defined in

packages/common/dist/config/ConfigurableModule.d.ts:18

Methods

create()

create(childContainerProvider): void

Parameters

childContainerProvider: ChildContainerProvider

Returns

void

Inherited from

SequencerModule.create

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

SequencerModule.start

Defined in

packages/sequencer/src/protocol/production/BatchProducerModule.ts:100