Lifecycle of the Integration
The lifecycle of integrating Ephemeral Rollups in your program is as follows:1
Write your Solana program as you normally would, using Anchor, native Rust,
Bolt, C, or even assembly.
2
Add delegation and undelegation hooks
Accounts that are delegated can be used as writable in an Ephemeral Rollup
session.
3
Deploy your program directly on Solana.
4
Ready to execute transactions for delegation and real-time speed
Execute your transactions without modifications on-chain and off-chain that
also comply with the SVM RPC specification.
Step 1: Write your program
A simple counter program have the following instructionsinitialize
and increment
:
Step 2: Add delegation and undelegation hooks
Delegation
is the process of transferring ownership of one or more of your program’sPDAs
to the delegation program. Ephemeral Validators will then be able to use thePDAs
to perform transactions in the SVM runtime.
Anchor framework example:Undelegation
is the process of transferring ownership of thePDAs
back to your program. On undelegation, the state is committed and it trigger the finalization process. Once state it validated, thePDAs
are unlocked and can be used as normal on mainnet
- Add
ephemeral-rollups-sdk
with Anchor features to your program
delegate
, commit
, ephemeral
, DelegateConfig
, commit_accounts
and commit_and_undelegate_accounts
:
- Add
delegate
macro and instruction,ephemeral
macro, andundelegate
instruction to your program. Specify your preferred delegation config such as auto commits and specific ER validator:
These public valdiators are supported for development. Make sure to upgrade
your program with the specific ER validator in delegation config:
- Asia (devnet): MAS1Dt9qreoRMQ14YQuhg8UTZMMzDdKhmkZMECCzk57
- EU (devnet): MEUGGrYPxKk17hCr7wpT6s8dtNokZj5U2L57vjYMS8e
- US (devnet): MUS3hc9TCw4cGC12vHNoYcCGzJG1txjgQLZWVoeNHNd
- Local ER (localhost): mAGicPQYBMvcYveUZA5F5UNNwyHvfYh5xkLS2Fr1mev
Step 3: Deploy your program on Solana
Now you’re program is upgraded and ready! Build and deploy to the desired cluster:Step 4: Ready to execute transactions for delegation and real-time speed
Use Anchor IDL file to build and send transactions:Frontend
These public RPC endpoints are currently free and supported for development:
Magic Router Devnet: https://devnet-router.magicblock.app
Solana Devnet: https://api.devnet.solana.com
ER Devnet: https://devnet.magicblock.app
TEE Devnet (test): https://tee.magicblock.app/
Magic Router Devnet: https://devnet-router.magicblock.app
Solana Devnet: https://api.devnet.solana.com
ER Devnet: https://devnet.magicblock.app
TEE Devnet (test): https://tee.magicblock.app/