Quick Access
If you prefer to dive straight into the code:Step-By-Step Guide
Build valid transactions that calls your program instructions for delegation and undelegation. The complete test for this project can be found in the Typescript Test Script.1
Set up connection and accounts
2
Test CPI hook to delegate state account on Base Layer
3
Test CPI hook to commit state account on ER
4
Test CPI hook to undelegate state account on ER
Counter Example
The following software packages may be required, other versions may also be compatible:| Software | Version | Installation Guide |
|---|---|---|
| Solana | 2.3.13 | Install Solana |
| Rust | 1.85.0 | Install Rust |
| Node | 24.10.0 | Install Node |
Code Snippets
- 1. Connection
- 2. Delegate
- 3. Commit
- 4. Undelegate
Import SDK and create Connection
Import relevant libraries@magicblock-labs/ephemeral-rollups-sdk or @magicblock-labs/ephemeral-rollups-kit. Initialize connection before testing and sending transactions.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: https://tee.magicblock.app/
Find out more details here .
Magic Router Devnet: https://devnet-router.magicblock.app
Solana Devnet: https://api.devnet.solana.com
ER Devnet: https://devnet.magicblock.app
TEE Devnet: https://tee.magicblock.app/
Find out more details here .
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

