Skip to content

eldarsmol/Countfire

Repository files navigation

Solana Ephemeral Rollups Counter Program

This is a minimal counter program built on Solana using Anchor and MagicBlock's Ephemeral Rollups (ER) runtime.
It demonstrates how to delegate program control to ER, perform high-frequency updates off-chain, and commit or undelegate the state back to Solana's L1.


Screenshot 2025-06-04 114501

Features

  • Anchor-based Solana smart contract
  • Counter logic using a deterministic PDA
  • Delegation to MagicBlock's ER
  • Commit & undelegate support
  • ER macros like #[ephemeral], #[delegate], #[commit] in action

Read the full walkthrough here:
Build the Fastest Counter Program on Solana Using MagicBlock

It covers:

  • Anchor + ER concepts
  • PDA design and patterns
  • Delegate/commit/undelegate flow
  • How to extend this logic in your own ER-based apps

Quick Start

1. Clone the repository

git clone https://github.com/kirtiraj22/magicblock-counter
cd magicblock-counter

2. Install dependencies

npm install

3. Build the program

anchor build

4. Deploy to localnet

anchor deploy

5. Run tests (skipping redeploy, rebuild, and validator spin-up)

anchor test --skip-deploy --skip-build --skip-local-validator

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors