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
Import SDK and initialize Connection
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
Quick Access
If you prefer to dive straight into the code:Native Rust Counter Program
Program Source Code
Program Tests
Test Scripts with Typescript
Local Development
Configure Custom Environment
Code Snippets
- Connection
- Delegate
- Commit
- 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

