Intelligent Contracts
Deploying

Deploying Intelligent Contracts

Deploying Intelligent Contracts on GenLayer means choosing a deployment method and network for moving Python-based contracts from local development toward testnet use. This guide covers local development through testnet deployment, including CLI direct deployment, deploy scripts, network configuration, and how to use each approach effectively.

Quick Start

Get started quickly with these essential deployment options:

Deployment Approaches

GenLayer offers two primary deployment methods:

CLI Direct Deployment

Perfect for quick deployments and simple contracts. Deploy with a single command:

genlayer deploy --contract contracts/my_contract.py --args "Hello World" 42

Learn more about CLI Deployment →

Deploy Scripts

Ideal for complex workflows, multi-contract deployments, and testnet environments:

export default async function main(client: GenLayerClient<any>) {
  // Deploy and configure multiple contracts
  const mainContract = await deployContract(client, "contracts/main.py", []);
  const helperContract = await deployContract(client, "contracts/helper.py", [mainContract]);
  
  await configureContracts(client, mainContract, helperContract);
}

Learn more about Deploy Scripts →

Networks Overview

Deploy to different networks based on your development stage:

NetworkPurposeWhen to Use
LocalnetLocal developmentDevelopment, debugging, initial testing
StudionetHosted developmentTeam collaboration, quick prototyping
TestnetAsimovInfrastructure testingStability, scalability, and stress testing
TestnetBradburyAI/LLM testingReal AI workloads and intelligent contract testing

Explore Network Configuration →

Development Workflow

Follow this recommended progression:

  1. Develop locally on localnet with full control
  2. Test collaboratively on studionet with your team
  3. Validate thoroughly on testnetBradbury in a production-like environment with real AI workloads
💡

Start with CLI deployment for simple contracts, then graduate to deploy scripts as your projects become more complex.

Contract Size and Packaging Notes

Intelligent Contracts are Python contracts executed by GenVM; they are not compiled to EVM bytecode. That means the usual EVM contract bytecode-size limit is not the right model when planning a GenLayer deployment.

Still keep deployed contracts reviewable and lightweight:

  • Split large applications into focused Python modules or cooperating contracts instead of one generated monolith.
  • Keep prompts, schemas, and fixtures concise; put bulky off-chain data behind stable URLs or content hashes when possible.
  • Use deploy scripts for multi-contract or multi-step deployments so addresses and constructor arguments are recorded repeatably.
  • If a contract is large because it contains mostly deterministic business logic, consider moving deterministic reads, indexing, caching, or UI-only aggregation outside consensus and only call GenLayer for decisions that require subjective or web-aware validation.
⚠️

If a deployment fails with a payload-size, package, or RPC error, treat it as a tooling or network-specific limit and reduce the deployment artifact before retrying. Do not assume Solidity patterns such as diamond proxies are required unless you are separately interacting with EVM contracts.

What's Next?

After deploying your contracts:

  1. Test Contract Functions: Use genlayer call and genlayer write to interact with deployed contracts
  2. Monitor Transactions: Check transaction receipts with genlayer receipt <txId>
  3. Build Frontend: Integrate with your deployed contracts using GenLayerJS (opens in a new tab)
  4. Debug Issues: Use the Debugging Guide if you encounter problems

Ready to start deploying? Choose your preferred method and dive into the detailed guides!