Intelligent Contracts
Network Configuration

Network Configuration

GenLayer supports three different networks, each serving specific purposes in the development lifecycle:

Localnet

Purpose: Local development and testing

  • When to use: During development, debugging, and initial testing
  • Setup: Requires running the GenLayer Studio locally with genlayer init and genlayer up
  • URL: http://localhost:4000/api (default)
  • Benefits:
    • Full control over validators and network configuration
    • No external dependencies
    • Fast transaction processing
    • Ability to reset database and validators

Setting up Localnet

# Initialize local network
genlayer init
 
# Start the local network
genlayer up

For complete setup instructions, examples, and video tutorials, see the GenLayer Studio Guide.

Studionet

Purpose: Hosted development environment

  • When to use: For development without local setup requirements
  • Setup: Accessible through studio.genlayer.com/api (opens in a new tab)
  • Benefits:
    • No local installation required
    • Pre-configured validators
    • Shared development environment
    • Ideal for quick prototyping
ℹ️

Studionet is perfect for getting started quickly or when you need to share your development environment with others.

Using Studionet

# Set network to studionet
genlayer network studionet
 
# Deploy to studionet
genlayer deploy --contract contracts/my_contract.py

TestnetAsimov

Purpose: Production-like testing environment

  • When to use: For final testing
  • Setup: Connect using network configuration
  • Benefits:
    • Production-like environment
    • Stable for testing dApp integrations
    • Shared testnet for community testing

Getting Testnet Tokens

Before deploying to TestnetAsimov, you'll need testnet tokens. Use the faucet to get free GEN tokens:

# Request testnet tokens
curl -X POST https://genlayer-faucet.vercel.app/api/faucet \
  -H 'Content-Type: application/json' \
  -d '{
    "address": "0xYourEVMAddressHere",
    "network": "Genlayer Testnet",
    "token": "GEN",
    "turnstileToken": ""
  }'

Important: Replace 0xYourEVMAddressHere with your actual EVM address.

Using TestnetAsimov

# Set network to testnet
genlayer network testnet-asimov
 
# Deploy to testnet
genlayer deploy --contract contracts/my_contract.py

Network Comparison

FeatureLocalnetStudionetTestnetAsimov
Setup ComplexityMediumNoneLow
Control LevelFullLimitedLimited
PersistenceLocal onlyTemporaryPersistent
CollaborationNoYesYes
PerformanceFastMediumProduction-like
Best forDevelopmentPrototypingPre-production testing

Development Workflow

We recommend following this progression:

  1. Start with Localnet: Develop and test your contracts locally with full control
  2. Test on Studionet: Validate contracts in a shared environment
  3. Deploy to TestnetAsimov: Final testing in a production-like environment

Managing Network Settings

Viewing Current Configuration

# Show all configuration
genlayer config get
 
# Show specific network setting
genlayer config get network

Setting Networks

The GenLayer CLI allows you to set a default network that will be used for all operations unless overridden.

Interactive Network Selection:

# Set network interactively
genlayer network

This command will show you available networks and let you choose:

? Select a network:
❯ localnet
  studionet  
  testnet-asimov
  custom

Direct Network Selection:

# Set specific network directly
genlayer network localnet
genlayer network studionet
genlayer network testnet-asimov

Network Switching Workflow

# Development workflow
genlayer network localnet
genlayer deploy --contract contracts/my_contract.py
 
# Testing workflow  
genlayer network studionet
genlayer deploy --contract contracts/my_contract.py
 
# Pre-production workflow
genlayer network testnet-asimov
genlayer deploy --contract contracts/my_contract.py

Network Configuration File

The CLI stores network configuration in ~/.genlayer/genlayer-config.json:

{
  "network": {
    "id": 61999,
    "name": "Genlayer Localnet",
    "rpcUrls": {
      ...
    }
  }
}

Manual Configuration

If needed, you can edit the configuration file directly:

# Open config file
code ~/.genlayer/genlayer-config.json
 
# Or edit with any editor
nano ~/.genlayer/genlayer-config.json

Next Steps