Micro-Rollup
The star of the show
The micro-rollup utility is the hero of the Stackr framework
A micro-rollup is initialized this -
index.ts
import { MicroRollup } from "@stackr/sdk";
/* ... other imports ... */
const rollup = await MicroRollup({
config: stackrConfig,
stateMachines: [machine],
});
await rollup.init();
The Micro-rollup object takes in 2 main parameters -
config
- The stackr configuration object
all the details that you set in the stackr.config.ts
file is passed to the micro-rollup like this. It uses this configuration to set up the environment for the rollup and instantiate the Sequencer, Executor and Syncer.
stateMachines
- The state machine
The state machine is the heart of the rollup. It defines the state transition rules and the actions that can be performed in each state.
Optional parameters
The Micro-Rollup object also takes in 1 optional parameter -
blockHooks
- An object containing two keyspre
andpost
both being ordered array of names of thehooks
to execute with each block.