Scaling solution for performant, composable games and applications.
This repository contains examples of how to use the different features available in an Ephemeral Rollup (ER). Read more about Ephemeral Rollups here.
To view integrated demos for specific usecases, please look at MagicBlock Starter Kits.
Core feature demos like delegation, randomness and privacy - the place to start.
|
|
|
|
|
|
|
|
|
Focused demos of individual capabilities β on-curve delegation, actions, ephemeral accounts, cranks, sessions.
|
|
|
|
|
|
End-to-end app templates you can fork and build on.
|
|
|
To run local tests for any example project, use the following steps:
-
Install Dependencies (Local nodes + example directory):
npm install -g @magicblock-labs/ephemeral-validator@latest cd <example-directory> yarn install
-
Setup local nodes:
yarn setup
-
Run Tests Locally:
yarn test:local
Example: To test the pinocchio-roll-dice example:
cd pinocchio-roll-dice
yarn build
yarn test:localSetting up local nodes:
- A Solana Test Validator preloaded with all the needed programs to work with ER.
- A local Ephemeral Rollup.
- The Query Filtering Service that replicates the privacy logic happening on TEE nodes, without hardware attestation.
graph LR
User((User))
SN["Solana Node:8899"]
ER["Ephemeral Rollup:7799"]
QFS["Query Filtering Service:6699"]
SN <--> ER
ER <--> QFS
QFS <--> User
Set the endpoint to the QFS if you want to test privacy features, or to the ER directly otherwise.
Older pre-Anchor 1.0 versions of the migrated programs are kept in
00-LEGACY_EXAMPLES. The 00- prefix keeps
these compatibility references listed before the active examples in
alphabetical folder views. These examples are for users who still need the
previous Anchor 0.32.1 implementations while upgrading to the current Anchor 1.0
programs.