Demo program for implementing a token transfer that can delegate and execute both on-chain and in the ephemeral rollup.
This program has utilized the following software packages.
| Software | Version | Installation Guide |
|---|---|---|
| Solana | 2.1.21 | Install Solana |
| Rust | 1.82 | Install Rust |
| Anchor | 0.31.1 | Install Anchor |
| Node | 22.17.0 | Install Node |
# Check and initialize your Solana version
agave-install list
agave-install init 2.1.21
# Check and initialize your Rust version
rustup show
rustup install 1.82
# Check and initialize your Anchor version
avm list
avm use 0.31.1To run tests on the devnet, use the following command:
anchor test --skip-local-validator --skip-build --skip-deploy
⚠️ Note: Make sure you have devnet SOL in your local wallet.
To run tests using a local ephemeral validator, follow these steps:
Ensure you have the ephemeral validator installed globally:
npm install -g @magicblock-labs/ephemeral-validatorRun the local validator with the appropriate environment variables:
ACCOUNTS_REMOTE=https://rpc.magicblock.app/devnet ACCOUNTS_LIFECYCLE=ephemeral ephemeral-validatorACCOUNTS_REMOTE point to the reference RPC endpoint, and ACCOUNTS_LIFECYCLE should be set to ephemeral.
Execute the tests while pointing to the local validator:
PROVIDER_ENDPOINT=http://localhost:8899 WS_ENDPOINT=ws://localhost:8900 anchor test --skip-build --skip-deploy --skip-local-validatorThis setup ensures tests run efficiently on a local ephemeral rollup while connecting to the devnet.