Step-By-Step Guide
The lifecycle of integrating Ephemeral Rollups in your program is as follows:1
Write your Solana program as you normally would.
2
Add delegation and undelegation hooks in your program
Add CPI hooks to delegate, commit and undelegate state accounts through
Ephemeral Rollup sessions.
3
Deploy your program on Solana.
Deploy your program directly on Solana using Anchor or Solana CLI.
4
Ready to execute transactions for delegation and real-time speed
Send transactions without modifications on-chain and off-chain that also
comply with the SVM RPC specification.
Counter Example

| Software | Version | Installation Guide |
|---|---|---|
| Solana | 2.1.21 | Install Solana |
| Rust | 1.82.0 | Install Rust |
| Anchor | 0.31.1 | Install Anchor |
| Node | 22.17.0 | Install Node |
Quick Access
Find the full basic counter example with Anchor framework implementation, or check out the Rust Native implementation:Anchor Counter Program
Program Source Code
Anchor Client App
React Client Source Code
Native Rust
Native Rust Program implementation
Code Snippets
- 1. Write program
- 2. Delegate
- 3. Deploy
- 4. Test
The program implements two main instructions:Nothing special here, just a simple Anchor program that increments a counter. The only difference is that we’re adding the
initialize: Sets the counter to 0increment: Increments the counter by 1
Delegate: Delegates counter from Base Layer to ER (called on Base Layer)CommitAndUndelegate: Schedules sync of counter from ER to Base Layer, and undelegates counter on ER (called on ER)Commit: Schedules sync of counter from ER to Base Layer (called on ER)Undelegate: Undelegates counter on the Base Layer (called on Base Layer through validator CPI)
ephemeral macro for undelegation and delegate macro to inject some useful logic to interact with the delegation program.⬆️ Back to TopPrivate Ephemeral Rollups (PER)
Integrate with an Anchor program
Native Rust
Integrate with a Native Rust program
Solana Explorer
Get insights about your transactions and accounts on Solana:Solana RPC Providers
Send transactions and requests through existing RPC providers:Solana Validator Dashboard
Find real-time updates on Solana’s validator infrastructure:Server Status
Subscribe to Solana’s and MagicBlock’s server status:Solana Status
Subscribe to Solana Server Updates
MagicBlock Status
Subscribe to MagicBlock Server Status
MagicBlock Products
Ephemeral Rollup (ER)
Execute real-time, zero-fee transactions securely on Solana.
Private Ephemeral Rollup (PER)
Protect sensitive data with privacy-preserving computation.
Verifiable Randomness Function (VRF)
Generate provably fair randomness directly on-chain.

