How I built an AI agent that generates production-ready blockchain infrastructure
The Problem
Setting up blockchain monitoring infrastructure typically requires:
- Writing RPC clients for Ethereum
- Building REST APIs
- Creating dashboards
- Managing configuration
- Writing tests
What if an AI agent could do all of this automatically?
The Solution
I built an agentic system that uses Groq’s ultra-fast LLM to generate a complete EVM blockchain processor in Go, complete with a React dashboard.
The agent loop:
CONFIG → PLAN → GENERATE → TEST → VALIDATE → EXECUTE → FIX
Each stage performs a specific task, and the agent iterates until everything works.
Architecture Overview
Press enter or click to view image in full size
How the Agent Works
The agent executes 7 stages in sequence:
`
Stage |What it does
CONFIG |Loads YAML configuration
PLAN |Build plan config based
GENERATE |Writes Go code u
TEST |Runs go tests
VALIDATE. |Checks go fmt and go vet
EXECUTE |Builds and runs
FIX |Auto-fixes compile errors
`
What the Generated Go Code Does
The agent produces a production-ready Go binary that:
-
Connects to Ethereum via RPC (Alchemy/Infura)
Fetches real-time data:- Current block height
- Gas price (in Gwei)
- Pending transaction count
- Calculates TPS (blocks/second)
Exposes REST API at :8080/api/metrics
Serves CORS-enabled endpoints for the dashboard.
The Dashboard
Press enter or click to view image in full size
The React dashboard displays real-time metrics:
Features:
- Auto-refreshes every 5 seconds
- Responsive design with Tailwind CSS
- CORS enabled for local development
What is EVM?
The Ethereum Virtual Machine (EVM) is the runtime environment for smart contracts on Ethereum and 50+ compatible chains.
Why it matters:
- DeFi: Uniswap, Aave, Compound
- NFTs: OpenSea, Blur
- DAOs: Decentralized governance
- Compatibility: Runs on Polygon, BSC, Avalanche, etc.
This system monitors the EVM (read-only) — it observes without executing transactions.
Project Structure
Press enter or click to view image in full size
Key files:
agentic-coding-evm-processor/
├── agent/ # Python agent (7 stages)
├── configs/ # YAML configuration
├── dashboard/ # React frontend
├── generated/ # Created by agent
├── .env # API keys
└── run_agent.py # Entry point
Prerequisites
- Python 3.9+
- Go 1.21+
- Node.js 18+
Required API Keys
Key |Purpose |Where to get
GROQ_API_KEY |LLM for code generation |console.groq.com
ETH_RPC_URL |Blockchain data |alchemy.com (free)
Setup & Run
- Clone the repository
git clone https://github.com/mmmattos/agentic-coding-evm-processor
cd agentic-coding-evm-processor
- Install dependencies
pip install -r requirements.txt
cd dashboard && npm install && cd ..
- Configure API keys
cp .env.example .env
- Edit .env with your GROQ_API_KEY and ETH_RPC_URL
Run the agent (generates Go code)
python run_agent.py
Start the Go backend
cd generated
go mod tidy
go run cmd/processor/main.go
- Start the dashboard (new terminal)
cd dashboard
npm start
Testing the API
curl http://localhost:8080/api/metrics
Response:
json
{
"blockHeight": 19500000,
"transactionsPerSecond": 0.12,
"gasPrice": 35,
"pendingTransactions": 127
}
Operating Modes
Press enter or click to view image in full size
Performance
Metric
Agent execution: ~30 seconds
Code generation: <500ms (Groq)
Go binary startup: <2 seconds
API response: <100ms
Dashboard refresh: 5 seconds
Why Groq?
- Groq's LPU (Language Processing Unit) provides:
- 10-100x faster inference than traditional LLMs
- Ultra-low latency perfect for agent loops
- Cost-effective for code generation
Without Groq, the agent still works in mock mode (using templates).
Common Issues & Solutions
`
Port 8080 in use: lsof -i :8080 && kill -9
Gas price shows 0: Check ETH_RPC_URL in .env
Dashboard won't compile:Run npm install in dashboard/
go.mod not found: Agent generates it — run agent first
`
Advanced: Production Deployment
For production, consider:
- eRPC proxy — Aggregates multiple RPC endpoints for failover
- Docker — Containerize Go backend and dashboard
- PostgreSQL — Store historical metrics
- Prometheus — Monitor the processor itself
What I Learned
Building this agent taught me:
Agent loops work — The 7-stage pipeline successfully generates working code
Groq is fast — Code generation in <500ms makes the agent feel interactive
Go is perfect for blockchain — Excellent concurrency and RPC support
React + Tailwind — Rapid dashboard development
EVM is accessible — Free RPC providers make monitoring easy
Try It Yourself
The complete code is available on GitHub:
👉 https://github.com/mmmattos/agentic-coding-evm-processor
Requirements:
- Free Groq API key (takes 2 minutes)
- Free Alchemy API key (takes 2 minutes)
- 10 minutes to run through the setup
Top comments (0)