# genlayer-project-boilerplate | GenLayer Labs | Knowledge Base | Instagit

GitHub Stars: 16.3k

Repository: https://github.com/genlayerlabs/genlayer-project-boilerplate

---

## Articles

### [GenLayer gl.nondet.web.render() Modes: text, html, and screenshot Explained](/genlayerlabs/genlayer-project-boilerplate/what-are-the-different-modes-for-gl-nondet-web-render)

Explore gl nondet web render modes text html and screenshot in GenLayer. Learn how to fetch web content as plain text raw HTML or a visual image for your contracts.

- Tags: deep-dive
- Published: 2026-08-20

### [How to Handle Integer Types in GenLayer Contracts: A Complete Guide to u256 and i256](/genlayerlabs/genlayer-project-boilerplate/how-to-handle-integer-types-in-genlayer-contracts)

Master integer types in GenLayer contracts. Learn to use u256 and i256 for state storage and ensure VM compliance with expert tips and guidance.

- Tags: deep-dive
- Published: 2026-08-20

### [GenLayer Intelligent Contract Structure: A Complete Technical Guide](/genlayerlabs/genlayer-project-boilerplate/what-is-the-structure-of-a-genlayer-intelligent-contract)

Explore the technical structure of a GenLayer intelligent contract. Learn how to define state with TreeMap DynArray and implement public methods for your decentralized applications.

- Tags: deep-dive
- Published: 2026-08-20

### [How GenLayer Maintains Consensus with Non-Deterministic Calls](/genlayerlabs/genlayer-project-boilerplate/how-does-genlayer-maintain-consensus-with-non-deterministic-calls)

Discover how GenLayer maintains consensus on non-deterministic calls. Learn about the Equivalence Principle and its role in ensuring byte-wise equality for secure state changes.

- Tags: internals
- Published: 2026-08-20

### [What Is the GenLayer Project Boilerplate? A Complete Starter Kit for AI-Native Blockchain Apps](/genlayerlabs/genlayer-project-boilerplate/what-is-the-genlayer-project-boilerplate-used-for)

Explore the GenLayer Project Boilerplate, a starter kit for AI-native blockchain apps. Build intelligent contracts in Python with automated testing and a Next.js frontend.

- Tags: getting-started
- Published: 2026-08-20

### [How to Perform Integration Testing with gltest in GenLayer](/genlayerlabs/genlayer-project-boilerplate/how-to-perform-integration-testing-with-gltest-in-genlayer)

Master integration testing in GenLayer with gltest. Deploy contracts locally, assert end-to-end behavior, and ensure seamless transaction and API interactions for robust smart contract development.

- Tags: how-to-guide
- Published: 2026-08-20

### [Common Linting Rules in GenLayer Contracts: Enforcing Determinism with genvm-lint](/genlayerlabs/genlayer-project-boilerplate/what-are-the-common-linting-rules-in-genlayer-contracts)

Discover common GenLayer contract linting rules enforced by genvm-lint. Ensure determinism, security, and compatibility with over 20 essential checks.

- Tags: best-practices
- Published: 2026-08-20

### [What is genvm-lint and How to Use It for GenLayer Smart Contracts](/genlayerlabs/genlayer-project-boilerplate/what-is-genvm-lint-and-how-to-use-it)

Discover genvm-lint, a fast static analysis tool for GenLayer smart contracts. Learn how to use it to catch deployment-blocking errors quickly and efficiently.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Test Contract Reverts in GenLayer Direct Mode](/genlayerlabs/genlayer-project-boilerplate/how-to-test-contract-reverts-in-genlayer-direct-mode)

Easily test contract reverts in GenLayer direct mode using pytest expect revert. Assert smart contract calls raise specific errors without live deployment.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Mock LLM Responses in GenLayer Direct Tests: A Complete Guide](/genlayerlabs/genlayer-project-boilerplate/how-to-mock-llm-responses-in-genlayer-direct-tests)

Easily mock LLM responses in GenLayer direct tests using the VM fixture and its mock_llm method. Intercept prompt calls and return deterministic stub data for reliable testing.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Mock Web Requests in GenLayer Direct Tests](/genlayerlabs/genlayer-project-boilerplate/how-to-mock-web-requests-in-genlayer-direct-tests)

Mock web requests in GenLayer direct tests using direct_vm.mock_web. Intercept HTTP calls and return controlled responses for reliable testing.

- Tags: how-to-guide
- Published: 2026-08-20

### [Benefits of Direct Mode Testing in GenLayer: A Complete Developer Guide](/genlayerlabs/genlayer-project-boilerplate/what-are-the-benefits-of-direct-mode-testing-in-genlayer)

Discover the benefits of direct mode testing in GenLayer. Execute intelligent contracts in-memory for millisecond feedback, full API coverage, and deterministic validation.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Create Payable Transactions in GenLayer Contracts](/genlayerlabs/genlayer-project-boilerplate/how-to-create-payable-transactions-in-genlayer-contracts)

Learn to create payable transactions in GenLayer contracts using @gl.public.write.payable and gl.message.value. Accept native tokens easily and securely in your decentralized applications.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Define Public Write Methods in GenLayer Contracts](/genlayerlabs/genlayer-project-boilerplate/how-to-define-public-write-methods-in-genlayer-contracts)

Learn how to define public write methods in GenLayer contracts. Use the @gl.public.write decorator to register state-modifying functions as transaction entry points, simplifying contract development.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Define Public View Methods in GenLayer Smart Contracts](/genlayerlabs/genlayer-project-boilerplate/how-to-define-public-view-methods-in-genlayer-contracts)

Learn to define public view methods in GenLayer contracts. Use the @gl.public.view decorator on Python functions to read contract state efficiently. Explore the GenLayer project boilerplate.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Integrate LLMs into GenLayer Contracts: A Complete Developer Guide](/genlayerlabs/genlayer-project-boilerplate/how-to-integrate-llms-into-genlayer-contracts)

Learn to integrate LLMs into GenLayer contracts using exec_prompt and strict_eq for deterministic AI consensus. Follow our developer guide for seamless integration.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Render Web Pages for Data Extraction in GenLayer Contracts](/genlayerlabs/genlayer-project-boilerplate/how-to-render-web-pages-for-data-extraction-in-genlayer-contracts)

Learn to render web pages for data extraction in GenLayer contracts using the gl nondet web render API. Fetch web content as text or screenshots for LLM processing.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Make HTTP GET Requests from a GenLayer Contract: Complete Implementation Guide](/genlayerlabs/genlayer-project-boilerplate/how-to-make-http-get-requests-from-a-genlayer-contract)

Learn how to make HTTP GET requests from GenLayer contracts using the gl.nondet.web.get API. Our guide explains the leader-validator consensus pattern for secure external data fetching and verification.

- Tags: how-to-guide
- Published: 2026-08-20

### [How GenLayer Smart Contracts Access the Internet: The `gl.nondet.web` API Explained](/genlayerlabs/genlayer-project-boilerplate/how-do-genlayer-contracts-access-the-internet)

Discover how GenLayer smart contracts access the internet using the gl.nondet.web API. Learn about fetching live web content and its validation for on-chain use.

- Tags: deep-dive
- Published: 2026-08-20

### [How to Deploy a GenLayer Contract with Python: Complete CLI Guide](/genlayerlabs/genlayer-project-boilerplate/how-to-deploy-a-genlayer-contract-with-python)

Deploy GenLayer contracts with Python using the GenLayer CLI. This guide details how to compile and upload bytecode to the GenVM for seamless smart contract deployment.

- Tags: how-to-guide
- Published: 2026-08-20

### [What Are the Allowed Storage Types in GenLayer Intelligent Contracts?](/genlayerlabs/genlayer-project-boilerplate/what-are-the-allowed-storage-types-in-genlayer-intelligent-contracts)

GenLayer intelligent contracts support five deterministic storage types including TreeMap DynArray Array u256 i256 and custom classes. Learn more about these powerful options.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Use Custom Dataclasses in GenLayer Contract Storage: A Complete Guide](/genlayerlabs/genlayer-project-boilerplate/how-to-use-custom-dataclasses-in-genlayer-contract-storage)

Learn to use custom dataclasses in GenLayer contract storage. Use the @allow_storage decorator and type-annotate fields in storage containers for seamless integration.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Handle Async Contract Operations in GenLayer: A Complete Guide](/genlayerlabs/genlayer-project-boilerplate/how-to-handle-async-contract-operations-in-genlayer)

Learn to handle async contract operations in GenLayer using a state-machine pattern with gl nondet functions and validators. Master asynchronous workflows in your GenLayer projects.

- Tags: how-to-guide
- Published: 2026-08-20

### [Common `@allow_storage` Decorator Pitfalls in GenLayer Contracts](/genlayerlabs/genlayer-project-boilerplate/what-are-common-pitfalls-with-allow_storage-decorator)

Discover common @allow_storage decorator pitfalls in GenLayer contracts. Learn how incorrect placement breaks compilation and invalidates storage types. Avoid these errors for robust GenLayer development.

- Tags: best-practices
- Published: 2026-08-20

### [Best Practices for Structuring Large GenLayer Contracts: A Complete Guide](/genlayerlabs/genlayer-project-boilerplate/best-practices-for-structuring-large-genlayer-contracts)

Master best practices for structuring large GenLayer contracts. Learn modular design, deterministic storage, and consensus safety for scalable development. Read the complete guide.

- Tags: best-practices
- Published: 2026-08-20

### [How to Perform Hex Conversion in GenLayer Contracts: Address API Guide](/genlayerlabs/genlayer-project-boilerplate/how-to-perform-hex-conversion-in-genlayer-contracts)

Learn how to perform hex conversion in GenLayer contracts using the Address API. Easily convert between raw bytes and EIP-55 checksummed hex strings with the Address constructor and as_hex property.

- Tags: api-guide
- Published: 2026-08-20

### [How to Work with Address Types in GenLayer Contracts: A Complete Guide](/genlayerlabs/genlayer-project-boilerplate/how-to-work-with-address-types-in-genlayer-contracts)

Master GenLayer Address types. Learn to create and use 20-byte blockchain addresses as TreeMap keys in this comprehensive guide.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Wait for Transaction Receipts Using `waitForTransactionReceipt` in GenLayer](/genlayerlabs/genlayer-project-boilerplate/how-to-wait-for-transaction-receipts-with-waittransactionreceipt)

Learn how to wait for transaction receipts with GenLayer's `waitForTransactionReceipt`. This function polls the blockchain to get receipt status, gas usage, and return data.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Create Custom Test Fixtures in GenLayer Direct Mode: A Complete Guide](/genlayerlabs/genlayer-project-boilerplate/how-to-create-custom-test-fixtures-in-genlayer-direct-mode)

Learn to create custom test fixtures in GenLayer direct mode by composing core fixtures in conftest.py. Streamline your testing with reusable utilities and decorators.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Validate LLM Outputs with strict_eq Equivalence Principle in GenLayer](/genlayerlabs/genlayer-project-boilerplate/how-to-validate-llm-outputs-with-strict_eq-equivalence-principle)

Learn how to validate LLM outputs using the strict_eq equivalence principle in GenLayer. Ensure byte-for-byte equality for deterministic consensus on LLM or web-fetched data.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Use Nested TreeMap Structures in GenLayer: A Complete Guide](/genlayerlabs/genlayer-project-boilerplate/how-to-use-nested-treemap-structures-in-genlayer)

Master nested TreeMap structures in GenLayer. Learn to use nested TreeMaps or JSON serialization for complex state management in this comprehensive guide. Optimize your contracts today.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Debug Failed Transactions in GenLayer: A Complete Guide for Smart Contract Developers](/genlayerlabs/genlayer-project-boilerplate/how-to-debug-failed-transactions-in-genlayer)

Debug failed transactions in GenLayer with direct-mode testing, gl.vm.log, and expect_revert. Learn to identify and fix contract reverts efficiently.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Debug Contract Reverts in GenLayer: A Complete Developer Guide](/genlayerlabs/genlayer-project-boilerplate/how-to-debug-contract-reverts-in-genlayer)

Debug contract reverts in GenLayer with direct_vm.expect_revert and print statements. This guide helps developers identify and fix revert issues efficiently in your GenLayer projects.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Run `genlayer deploy` for Contract Deployment](/genlayerlabs/genlayer-project-boilerplate/how-to-run-genlayer-deploy-for-contract-deployment)

Learn how to run genlayer deploy for contract deployment. This guide explains the necessary RPC environment variables and contract file paths for deploying Python smart contracts to the GenLayer network.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Configure `genlayer deploy` for Contract Deployment on GenLayer](/genlayerlabs/genlayer-project-boilerplate/how-to-configure-genlayer-deploy-for-contract-deployment)

Learn how to configure genlayer deploy for contract deployment. Master RPC network setup and contract file paths with this essential guide.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Connect a MetaMask Wallet to GenLayer Contracts: A Complete Guide](/genlayerlabs/genlayer-project-boilerplate/how-to-connect-metamask-wallet-with-genlayer-contracts)

Learn how to connect your MetaMask wallet to GenLayer contracts. This guide covers network switching, account access, and creating an SDK client for signed transactions on chain ID 61999.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Estimate Transaction Fees with GenLayer-JS Fee Presets](/genlayerlabs/genlayer-project-boilerplate/how-to-estimate-transaction-fees-with-genlayer-js-fee-presets)

Easily estimate transaction fees with GenLayer-JS fee presets. Learn how to map levels low standard or high to deterministic fees and get accurate transaction payloads.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Integrate the FootballBets Contract with a Next.js Frontend](/genlayerlabs/genlayer-project-boilerplate/how-to-integrate-footballbets-contract-with-nextjs-frontend)

Integrate the FootballBets contract with Next.js. Deploy to GenLayer, expose the address, and use typed React hooks with genlayer-js for seamless frontend integration.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Handle Contract Errors with expect_revert in GenLayer Tests](/genlayerlabs/genlayer-project-boilerplate/how-to-handle-contract-errors-with-expect_revert-in-genlayer-tests)

Learn to handle contract errors in GenLayer tests using expect_revert. Assert failed contract calls with specific error messages for robust testing.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Write Direct Mode Tests with the mock_llm Fixture in GenLayer](/genlayerlabs/genlayer-project-boilerplate/how-to-write-direct-mode-tests-with-mock_llm-fixture)

Learn to write direct mode tests with the mock_llm fixture in GenLayer. Intercept LLM calls and return deterministic JSON for fast, reliable unit tests without external dependencies.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Write Direct Mode Tests with the mock_web Fixture in the GenLayer Boilerplate](/genlayerlabs/genlayer-project-boilerplate/how-to-write-direct-mode-tests-with-mock_web-fixture)

Learn to write direct mode tests with the mock_web fixture in the GenLayer boilerplate. Intercept HTTP calls for deterministic contract testing with direct_vm.

- Tags: how-to-guide
- Published: 2026-08-20

### [What Is the Equivalence Principle in GenLayer?](/genlayerlabs/genlayer-project-boilerplate/what-is-the-equivalence-principle-in-genlayer)

Discover the equivalence principle in GenLayer a consensus mechanism allowing validators to agree on nondeterministic operations. Learn how it separates execution for verification.

- Tags: deep-dive
- Published: 2026-08-20

### [How to Use LLM Prompts with `gl.nondet.exec_prompt` in GenLayer Contracts](/genlayerlabs/genlayer-project-boilerplate/how-to-use-llm-prompts-with-gl-nondet-exec_prompt-in-genlayer-contracts)

Learn to use LLM prompts with gl.nondet.exec_prompt in GenLayer contracts. Wrap calls in gl.eq_principle.strict_eq for validator consensus on non-deterministic output.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Implement Web Requests with gl.nondet.web.render in GenLayer Smart Contracts](/genlayerlabs/genlayer-project-boilerplate/how-to-implement-web-requests-with-gl-nondet-web-render-in-genlayer)

Learn to implement web requests in GenLayer smart contracts using gl.nondet.web.render. Fetch external content and process it with LLMs for deterministic consensus. Explore the GenLayer project boilerplate for hands on examples.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Use DynArray Storage in GenLayer Contracts: A Complete Guide](/genlayerlabs/genlayer-project-boilerplate/how-to-use-dynarray-storage-in-genlayer-contracts)

Master DynArray storage in GenLayer contracts for O(1) appends and persistent indexed access. Our guide explains this essential GenVM data management tool.

- Tags: how-to-guide
- Published: 2026-08-20

### [How to Use TreeMap Storage in GenLayer Contracts: Declaration, Nested Maps, and JSON Workarounds](/genlayerlabs/genlayer-project-boilerplate/how-to-use-treemap-storage-in-genlayer-contracts)

Learn how to use TreeMap storage in GenLayer contracts for deterministic key-value persistence. Explore declaration, nested maps, and JSON workarounds effectively.

- Tags: how-to-guide
- Published: 2026-08-20

