with one click
genlayer-cli
// Use the GenLayer CLI to inspect, interact with, and debug this repo's intelligent contracts.
// Use the GenLayer CLI to inspect, interact with, and debug this repo's intelligent contracts.
Design, deploy, and monitor a GenLayer Intelligent Oracle prediction market from any coding agent. Use when a user wants to create a settled-by-web-evidence prediction market without opening the web UI.
Deploy GenLayer intelligent contracts using the deployment script. User-invoked only.
Write and run fast direct-mode pytest tests for this repo's GenLayer intelligent contracts.
Validate this repo's GenLayer intelligent contracts with the GenVM linter.
Run or design live-environment GenLayer tests for this intelligent-oracle repo.
Run tests and build checks across the intelligent-oracle project. Use after making changes to validate nothing is broken.
| name | genlayer-cli |
| description | Use the GenLayer CLI to inspect, interact with, and debug this repo's intelligent contracts. |
| allowed-tools | ["Bash","Read"] |
Use this skill for local Studio management, account/network inspection, contract calls, receipts, and transaction debugging. For this repo's normal factory deployment, prefer the deploy skill, which runs the scripts/ package.
npm install -g genlayer
genlayer network set
genlayer network set studionet
genlayer network set localnet
genlayer network info
genlayer network list
Built-in networks include localnet, studionet, testnet-asimov, and testnet-bradbury.
Use genlayer network set for built-in networks. Avoid --rpc for built-ins because it can bypass chain metadata needed for polling and receipt decoding.
StudioNet is gasless. A zero GEN balance is normal there.
genlayer account
genlayer account list
genlayer account create --name dev1
genlayer account use dev1
genlayer account unlock
genlayer account lock
genlayer account import --name imported --private-key 0x...
Headless environments may not support keychain unlock. Commands that sign transactions can prompt for a keystore password unless a deployment script uses env-based private keys.
This repo deploys the registry factory through scripts/deploy.ts using genlayer-js:
cd scripts && npm run deploy
The deploy script reads:
scripts/.env PRIVATE_KEYscripts/.env RPC_URLintelligent-contracts/IntelligentOracleFactory.pyintelligent-contracts/IntelligentOracle.pyAfter deployment, copy the registry address into root app envs:
IC_REGISTRY_ADDRESS=0x...
NEXT_PUBLIC_IC_REGISTRY_ADDRESS=0x...
Avoid direct CLI deployment for the registry factory in normal work. The factory constructor needs the full oracle source code as an argument, and the scripts/ package already handles that in the same way the project expects.
Use CLI deployment only for isolated experiments where the deployed contract does not need to match the app's registry flow.
Read calls:
genlayer call <registry-address> get_contract_addresses
genlayer call <oracle-address> get_dict
genlayer call <oracle-address> get_status
Write calls:
genlayer write <oracle-address> resolve --args "https://example.com/evidence"
The registry write method used by the API is:
create_new_prediction_market(
prediction_market_id,
title,
description,
potential_outcomes,
rules,
data_source_domains,
resolution_urls,
earliest_resolution_date
)
genlayer receipt <txHash>
genlayer receipt <txHash> --stdout
genlayer receipt <txHash> --stderr
genlayer receipt <txHash> --status FINALIZED --retries 50 --interval 3000
Debug order:
genlayer schema <address>.genlayer code <address>.scripts/deploy.ts.genlayer init
genlayer up
genlayer up --reset-db
genlayer stop
When switching to local Studio, update both server and browser envs in the root app:
GENLAYER_RPC_URL=http://localhost:4000/api
NEXT_PUBLIC_GENLAYER_RPC_URL=http://localhost:4000/api