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