Micro-Rollup Utilities
Extending the use cases
Micro-Rollup Object returns a bunch of useful utilities that can be used for interacting with it, getting more data out, or work on side-effects
You can access all of these as return values from the microRollup
object
actions
Actions utility is used to both send an action to the micro-rollup and fetch an action from the micro-rollup. It exposed 3 methods
getSchema
returns the schema of the action
submit
submits an action to the micro-rollup
fetch
fetches an action from the micro-rollup using the action hash
usage example
state
You can access the latest state from within the micro-rollup using this function
get
returns the latest state
usage example
chain
You can access the current chain properties. There are 3 methods available
getCurrentHeight
returns the current height of the chain
getBlockByHeight
returns the block at a given height
getBlockByHash
returns the block at a given hash
usage example
builder
if you select {autorun: false}
for builder you can manually build a batch of actions like this
syncer
if you select {autorun: false}
for syncer you can manually build a batch of actions like this
events
Stackr uses a custom event emitters to notify of stuff happening behind the scenes like batching, execution etc. You can leverage these events to build your own custom logic on top of the stackr engine
The available events are as follows:
These can be used like this
For confimations
- C0 = Application receives the action and returns a “signed” acknowledgement
- C1 = Action that was included in a block gets executed
- C2 = The block was verified by Vulcan
- C3 = The block was posted on L1 by Vulcan