@XAMTO_AI: Before writing AI contracts: setting up environments, writing tests, configuring frontends, handling deployments—no business logic written, time wasted. Now: GenLayer Project Boilerplate, clone and run. Complete football betting example, network access + LLM integration ready-made, Direct mode testing in milliseconds…
Summary
GenLayer Labs has released a project template that simplifies smart contract development, providing a complete football betting example with integrated network access and LLM, supporting fast testing and CI pipelines.
View Cached Full Text
Cached at: 08/20/26, 09:02 PM
Previously, writing AI contracts: setting up environment, writing tests, configuring frontend, handling deployment—no business logic written yet, time’s up.
Now: GenLayer Project Boilerplate, clone, run.
Complete football betting example, web access + LLM integration ready-made.
Direct mode testing at millisecond-level speed, no Studio needed.
Integration tests, contract linter, CI pipeline all set up.
Frontend Next.js 15 + TypeScript + TanStack Query, ready out of the box.
https://github.com/genlayerlabs/genlayer-project-boilerplate…
genlayerlabs/genlayer-project-boilerplate
Source: https://github.com/genlayerlabs/genlayer-project-boilerplate
Sample GenLayer project
License: MIT (https://opensource.org/license/mit/) Discord (https://discord.gg/8Jm4v89VAu) Telegram (https://t.me/genlayer) Twitter (https://x.com/GenLayer) GitHub star chart (https://star-history.com/#yeagerai/genlayer-js)
About
This project includes the boilerplate code for a GenLayer use case implementation, specifically a football bets game.
What’s included
- An example intelligent contract (Football Bets) with web access and LLM integration
- Direct mode tests — fast, in-memory unit tests with web/LLM mocking (~ms per test)
- Integration tests — full end-to-end tests against GenLayer Studio
- Contract linting — static analysis to catch common contract issues before deployment
- CI pipeline — GitHub Actions workflow for linting and direct tests
- A production-ready Next.js 15 frontend with TypeScript, TanStack Query, and Radix UI
- Configuration file template and deployment scripts
Requirements
- Python >= 3.12
- GenLayer CLI (https://github.com/genlayerlabs/genlayer-cli) globally installed:
npm install -g genlayer - GenLayer Studio (for integration tests and deployment): Install from Docs (https://docs.genlayer.com/developers/intelligent-contracts/tooling-setup#using-the-genlayer-studio) or use the hosted GenLayer Studio (https://studio.genlayer.com/)
Project Structure
contracts/ # Python intelligent contracts tests/ direct/ # Fast in-memory tests (no Studio required) test_create_bet.py # Bet creation logic test_resolve_bet.py # Bet resolution with web/LLM mocks test_views.py # Read-only view methods integration/ # Full tests against GenLayer Studio test_football_bets.py fixtures.py # Expected state fixtures frontend/ # Next.js 15 app (TypeScript, TanStack Query, Radix UI) deploy/ # TypeScript deployment scripts gltest.config.yaml # Test runner network configuration pyproject.toml # Python/pytest configuration .github/workflows/ # CI pipeline
Quick Start
1. Set up Python environment
``shell python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt
### 2. Lint your contracts
Run the GenVM linter to catch issues before deployment:
``shell
genvm-lint check contracts/football_bets.py
The linter catches:
- Forbidden imports and non-deterministic calls
- Invalid storage types (must use
TreeMap,DynArray,u256, etc.) - Missing decorators and return type annotations
- Non-deterministic operations outside equivalence principle blocks
- And 20+ other rules (https://github.com/genlayerlabs/genvm-linter)
3. Run direct mode tests
Direct mode tests run contracts in-memory without needing GenLayer Studio. They use mocks for web requests and LLM calls, giving you fast feedback (~milliseconds per test):
``shell pytest tests/direct/ -v
Direct mode features used in these tests:
- `direct_deploy("contracts/file.py")` — deploy contract in memory
- `direct_vm.sender = address` — set transaction sender
- `direct_vm.mock_web(pattern, response)` — mock HTTP/render calls
- `direct_vm.mock_llm(pattern, response)` — mock LLM responses
- `direct_vm.expect_revert("message")` — assert expected failures
- `direct_vm.clear_mocks()` — reset mocks between calls
### 4. Deploy the contract
1. Choose your network: `genlayer network`
2. Deploy: `genlayer deploy` (runs the script in `/deploy/deployScript.ts`)
### 5. Run integration tests
Integration tests deploy the contract to GenLayer Studio and test with real consensus:
``shell
gltest tests/integration/ -v -s
These require GenLayer Studio running (local or hosted).
6. Set up the frontend
- Copy
frontend/.env.exampletofrontend/.env - Add your deployed contract address as
NEXT_PUBLIC_CONTRACT_ADDRESS - Run:
``shell cd frontend npm install npm run dev
The app will be available at http://localhost:3000/.
## How the Football Bets Contract Works
1. **Creating Bets**: Users bet on a football match by providing the game date, teams, and predicted winner.
2. **Resolving Bets**: After the match, the contract fetches results from BBC Sport, uses an LLM to extract the score, and validates via the equivalence principle.
3. **Points**: Correct predictions earn points. Users can query their points or the leaderboard.
## Testing Strategy
| Test Type | Command | Speed | Requires Studio |
|-----------|---------|-------|-----------------|
| **Lint** | `genvm-lint check contracts/*.py` | ~250ms | No |
| **Direct** | `pytest tests/direct/ -v` | ~ms/test | No |
| **Integration** | `gltest tests/integration/ -v -s` | ~min/test | Yes |
**Recommended workflow:**
1. Lint after every contract change
2. Run direct tests frequently during development
3. Run integration tests before deployment to verify consensus behavior
For AI coding agents (Claude Code, Cursor, etc.), the linter and direct tests provide the fast feedback loop needed for iterative development without requiring a running Studio instance.
## Community
- **Discord (https://discord.gg/8Jm4v89VAu)**: Discussions, support, and announcements
- **Telegram (https://t.me/genlayer)**: Informal chats and quick updates
## Documentation
For detailed information, see our documentation (https://docs.genlayer.com/).
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Similar Articles
genlayerlabs/genlayer-project-boilerplate
This GitHub repository offers a boilerplate project for GenLayer, featuring an example intelligent contract with LLM integration, including tests, linting, and a Next.js frontend.
@Xudong07452910: Open source project recommendation: loop-engineering — a practical framework that gives your AI coding agent self-looping and intelligent orchestration capabilities. loop-engineering is a very popular concept right now, offering practical patterns, starters, and CLI tools to help developers design systems…
loop-engineering is an open-source framework that provides self-looping and intelligent orchestration capabilities for AI coding agents (such as Claude Code, Codex, Cursor). It includes 7 production-grade loop patterns, practical CLI tools, and a five-data-block design, helping developers transition from manual prompting to systematic automation.
@ba_niu80557: Let's talk some hardcore practical knowledge while I have time this morning. What actually happens between signing a contract for an AI project and it finally running in production? I'll lay out the entire playbook. People in this field can copy it directly, and those not in it can still understand why 95% of enterprise AI pilots end up dead. First, let me say something counterintuitive to the point you might not believe...
This article discusses common reasons for the failure of enterprise AI projects from proof-of-concept to production deployment, highlighting key practices such as MLOps, early inspection of real data, and clear human-machine boundaries. It argues that project failures are often not due to model issues but due to neglect of the engineering implementation phase.
@laobaishare: GitHub steps in directly — from now on, no AI will write code blindly anymore. --- The newly released Spec Kit has soared to 95K stars in just a few days. The core idea is simple: make AI clearly specify what to do before touching any code. No more throwing a vague prompt and praying the agent doesn't blow up your project.
GitHub has released Spec Kit, a tool that forces AI to generate structured specifications before writing code, including understanding requirements, asking for missing details, organizing the project, and more. It significantly reduces AI-generated error-prone code and is compatible with 25+ AI agents.
@cxjwin: Found a very practical website collecting various ready-made Agent Loop templates. Core idea: stop manually prompting all the time; design the loop so the agent runs the task on its own. It includes Test Until Green, Fix CI Until G…
Shared a practical website that collects ready-made Agent Loop templates. The core idea is to let the AI agent automatically complete tasks. It includes common loops like Test Until Green, and is suitable for use with Claude Code and Cursor.