glsim — Local GenLayer Network
A lightweight single-process GenLayer network that runs contracts via direct mode. Supports real LLM and web calls without Docker or WASM.
Installation
pip install genlayer-test[sim]Usage
# Start with defaults (port 4000, 5 validators)
glsim
# Custom configuration
glsim --port 8000 --validators 3 --llm-provider openai:gpt-4o
# Deterministic mode (reproducible addresses)
glsim --seed my-test-seedCLI Options
| Option | Default | Description |
|---|---|---|
--port | 4000 | RPC server port |
--host | 127.0.0.1 | Bind address |
--validators | 5 | Number of validators |
--max-rotations | 3 | Max leader rotations |
--chain-id | 61127 | Network chain ID |
--llm-provider | None | LLM provider:model (e.g., openai:gpt-4o) |
--no-browser | false | Use httpx instead of Playwright for web |
--seed | None | Deterministic seed for addresses |
-v, --verbose | false | Verbose logging |
JSON-RPC Methods
glsim exposes a JSON-RPC 2.0 endpoint at POST /api compatible with both GenLayer Studio and standard Ethereum methods:
GenLayer Methods
gen_call— Call a contract methodgen_get_contract_schema— Get contract schemagen_get_contract_schema_for_code— Get schema from codegen_get_transaction_status— Get transaction status
Simulator Methods
sim_deploy— Deploy a contractsim_call— Call a contract methodsim_read— Read contract statesim_fund_account— Fund an accountsim_get_balance— Get account balancesim_create_snapshot— Create state snapshotsim_restore_snapshot— Restore snapshotsim_install_mocks— Install web/LLM mockssim_get_mocks— Get current mockssim_increase_time— Advance time (Anvil-style)sim_set_time— Set time to specific datetime
Ethereum Compatible
eth_chainId,eth_blockNumber,eth_getBalanceeth_getTransactionReceipt,eth_getTransactionByHasheth_estimateGas,eth_gasPrice,eth_sendRawTransaction