Let's run it now
Interact with the Micro-Rollup and build some blocks
Micro-rollups are simple creatures, they are just like a backend application that can be interacted with via HTTP requests.
1. Start the Micro-Rollup
If all goes well you should see the following output:
Your rollup is now running on port 3000. Stackr’s Micro-rollups are simply NestJS applications that have a bunch of modules responsible for different things like execution, batching, syncing state etc.
2. Interact with the Micro-Rollup
The template comes with a simple HTTP server that can be used to interact with the rollup. It exposed 2 endpoints for getting current state and also sending new actions.
There is also a test script that can be used to send a bunch of actions to the rollup. This script is located at test/stress-test.ts
. You can run it like so in a separate terminal:
If all goes well you should see the following output (16 times):
and on the rollup side you should see something like this:
This means that the rollup has processed the action and has created a new block. You can also see that the block has been confirmed by the Vulcan Node (C2) and data has been posted on L1 (C3).
3. Check the state
if you query the http://localhost:3000/
endpoint as a GET request on you should see something like this:
This means that the rollup has processed all the actions and has updated the state accordingly.
Congratulations! 🎉
This is your first Micro-Rollup.
Next Steps
You can now start building your own rollup by modifying the code in src/state.ts
and src/index.ts
files.