CLI command guide
Reference for the command-line tools shipped in the repository: network profiles, the node, wallet, pool and miner CLIs, with their key flags and example invocations.
10 min read 2,166 words
View docs/cli-commands.md on GitHub
Source: docs/cli-commands.md — this page mirrors the repository documentation.
Naming note. Older repository documents call the signature scheme “Dilithium3”; that is the lineage name for ML-DSA-65 (FIPS 204, scheme id
0x1003), the only signature scheme mainnet accepts for new transactions. Where SPHINCS+ is mentioned as a backup scheme, note that on mainnet it is legacy and consensus-stranded: it cannot sign transactions.
Network note. Examples that mention a local devnet or a faucet apply to development networks only. Mainnet is chain id
1, reachable athttps://rpc.animica.org/rpc; there is no mainnet faucet.
This guide collects the main command-line tools shipped in the repository and summarizes how to invoke them plus their key flags.
Network profiles & orchestration
Profile defaults for devnet/testnet/mainnet live under ops/profiles/ and
include RPC URLs, Stratum/API binds, DB URIs, and seed lists. Use ops/run.sh
to source a profile and start common services:
# default devnet (node + pool background, dashboard foreground)
ops/run.sh all
# profile aware shortcuts
ops/run.sh --profile testnet node
ops/run.sh --profile mainnet pool
ops/run.sh dashboard
ops/run.sh all keeps the node and pool running in the background and exports
ANIMICA_NETWORK, ANIMICA_RPC_URL, ANIMICA_STRATUM_BIND, ANIMICA_POOL_API_BIND,
and related DB URIs so the Python CLIs (node, pool, wallet) inherit consistent
settings. Stop the dashboard with Ctrl+C to clean up the background services.
Node CLI
Thin Typer surface for quick JSON-RPC checks. Available as animica-node or
python -m animica.cli.node:
statusprints RPC URL, chain ID, head, sync status, network hashrate, and (when available) the full head block. Use--hashrate-windoworANIMICA_HASHRATE_WINDOWto tune the sample size.headdumps the JSON head payload.block --height Norblock --hash 0x...fetches a block; height lookups fall back to hash queries when needed.tx --hash 0x...retrieves a transaction by hash.
Example against a running devnet node:
animica-node status --rpc-url $ANIMICA_RPC_URL
animica-node block --height 1 --rpc-url $ANIMICA_RPC_URL
Mining & Pool CLI
The mining CLI (animica miner or animica-mining/animica-pool) provides both development mining utilities and Stratum pool management. Commands:
Mining for Development
mine-blocks [<addr>] --count <n> [--address <addr>] [--rpc-url <url>] [--verbose]mines N blocks to a given payout address via RPC. This is useful for local testing and development.- Address resolution: Accepts wallet label (e.g.,
premine) or Bech32 address (e.g.,anim1...) - Positional or option: Address can be provided as positional arg or via
--addressflag - Mempool integration: Pending transactions are included in mined blocks and executed
- Verbose mode: Use
--verboseor-vto see transaction details per block - Validates that count > 0 and provides clear error messages
- Address resolution: Accepts wallet label (e.g.,
Examples:
# Mine with positional address (wallet label)
animica miner mine-blocks --count 5 premine
# Mine with --address option (backward compatible)
animica miner mine-blocks --address anim1test123 --count 5
# Mine with verbose output to see transactions
animica miner mine-blocks --count 10 --verbose premine
# Mine with custom RPC endpoint
animica miner mine-blocks --address anim1test123 --count 10 --rpc-url http://localhost:8545
The mining process:
- Selects pending transactions from mempool (nonce-ordered, fee policy enforced)
- Executes transactions to update state (balances, nonces)
- Finds valid block hash via proof-of-work
- Includes transactions and receipts in the mined block
- Credits block reward to the payout address
- Removes included transactions from the mempool
Stratum Pool Operations
animica pool upstarts the Stratum + metrics API with pid/log tracking.animica pool statusreports process state and probes/healthz+/summary.animica pool downstops the managed pool.animica pool initwrites a starter env file for local operation.animica pool doctorvalidates node RPC connectivity, payout address, template generation, and pool API health.animica pool test-jobfetches a realminer.getBlockTemplatepayload and verifies the header is submit-ready.animica pool list-workersprints worker stats from the managed pool API.animica pool show-configprints the resolved pool configuration.animica stratum ...remains supported as a compatibility alias for the same managed pool commands.run-poolremains available as the lower-level direct launcher and still usesANIMICA_RPC_URL,ANIMICA_STRATUM_BIND,ANIMICA_POOL_API_BIND, andANIMICA_MINING_POOL_DB_URL(CLI flags override env vars).show-configprints the resolved pool configuration.generate-payout-addressmints a dev payout address using the wallet helpers.
Example matching the devnet profile:
animica pool up --daemon --profile hashshare --rpc-url $ANIMICA_RPC_URL
animica pool doctor
animica pool status
Smoke validation:
./scripts/smoke_stratum.sh
ENA CLI
animica ena serve start --daemonlaunches the local ENA node in dev mode.animica ena serve status/animica ena serve stopmanage the local ENA daemon.animica ena infer --local "prompt"hits the local/v1/inferencepath with no on-chain payment.animica ena train submit --plan <file> --budget 0 --payer local-dev --endpoint http://127.0.0.1:8000submits a local training job.animica ena train watch <job_id> --jsonpolls training status.animica ena checkpoints list|fetch|publishmanages locally published checkpoint bundles.animica ena models pull|exportdownloads or exports the active local model artifact.
Smoke validation:
./scripts/smoke_ena.sh
Wallet CLI
Developer-friendly wallet/address helper built on the PQ registry. Invoke via
the console script (animica-wallet) or module (python -m animica.cli.wallet)
with the following subcommands:
create --label <name> [--allow-insecure-fallback]create a new Dilithium3- style keypair, derive a bech32manim1…address, and persist it to~/.animica/wallets.json(default wallet store location).listshow known addresses and algorithms (bech32m/anim HRP).show <address|label|pubkey_hex> [--rpc-url ...]print the wallet entry plusstate.getBalancefrom the configured RPC endpoint. Lookup by address (full bech32), label, or public key hex.export <address|label|pubkey_hex> --out wallet.json/import --file wallet.jsonround-trip secrets in a JSON format that keeps the bech32m encoding intact.set-default <address|label|pubkey_hex>mark a wallet as the default.
The wallet file defaults to ~/.animica/wallets.json and can be overridden via
--wallet-file flag or ANIMICA_WALLETS_FILE environment variable.
Example workflow to generate and verify an address against a running node:
animica-wallet create --label dev1 --allow-insecure-fallback
animica-wallet list
# Query balance over JSON-RPC (state.getBalance) - by address or label
animica-wallet show anim1... # by address
animica-wallet show dev1 # by label
animica-wallet show dev1 --rpc-url $ANIMICA_RPC_URL
# Export by label or address
animica-wallet export dev1 --out backup.json
Addresses emitted by the wallet, explorer, and pool payout configs all follow
anim bech32m encoding (alg_id || sha3_256(pubkey)) per docs/spec/ADDRESSES.md.
Contract CLI
The contract workflow is available under animica contract:
compilesource to an artifact (+ optional ABI/manifest outputs)deployfrom artifact/source, optional--save --name <alias>callread-only method by alias or addresssendstate-changing method by alias or addressinspect,address,estimate-gas,encode-calldata,decode-resultlist-artifactsto view saved artifacts/deployments
Example Counter flow:
animica contract compile vm_py/examples/counter/contract.py --out build/counter.avm --abi-out build/counter.abi.json --overwrite
animica contract deploy build/counter.avm --from main --abi build/counter.abi.json --save --name counter --wait
animica contract call counter get
animica contract send counter inc --from main --wait
animica contract call counter get
Storage locations:
- artifacts:
~/.animica/contracts/artifacts/ - deployments:
~/.animica/contracts/deployments/<network-key>/
See docs/dev/CONTRACTS_CLI.md for full command reference, JSON args examples, and troubleshooting.
VM(Py) tooling
Running commands
All examples below assume the repository root as the working directory. Use the project-managed virtual environment and scripts when available:
- Prefer
pnpmfor Node-based tools (e.g.,pnpm cli <command>where applicable) andpython -mfor Python entrypoints to ensure dependencies resolve correctly. - Export any required environment variables (such as
PYTHONPATHadditions) viasource ./scripts/dev/env.shbefore running the commands if your setup depends on repository-local modules. - If a command is also shipped as a console script (for example,
omni-vm-compile), you can run it directly or viapython -mto guarantee the module path is correct.
omni-vm-compile
Compile a deterministic Python contract to Animica VM IR bytes. Works via python -m vm_py.cli.compile or the console script alias. Key flags:
path/to/contract.py --out out.ir(required output path) or--manifest manifest.json --out out.ir--format {cbor,json}to pick IR encoding (default CBOR)--meta META.jsonto save compile metadata--stdin/-to read source from stdin--quietto suppress stderr logs 【F:vm_py/cli/compile.py†L3-L20】【F:vm_py/cli/compile.py†L8-L16】
omni-vm-run
Run a compiled contract for a single function call using a manifest that points to the source/IR. Important arguments:
--manifest PATH(required) to the contract manifest--call NAME(required) function to invoke--args JSONto supply a JSON array of call arguments--hex-as-bytes/--no-hex-as-bytestoggle for converting0xstrings to bytes--format {text,json}for the result output (defaults to JSON)--quietto silence stderr logging 【F:vm_py/cli/run.py†L3-L17】【F:vm_py/cli/run.py†L296-L315】
omni-vm-inspect-ir
Inspect compiled IR, optionally compiling from a manifest or source first, and report metadata such as gas estimates and hashes. Accepts one of:
--ir FILEto load compiled IR bytes--manifest FILEto compile a manifest then inspect--source FILEto compile Python source then inspect Optional controls:--format {text,json},--max-depth,--max-bytes,--show-ir-bytes,--quiet. 【F:vm_py/cli/inspect_ir.py†L3-L48】
P2P utilities
animica-p2p peer
Peer store maintenance with subcommands:
listshow known peersadd <peer_id> <addr>with optional--probe/--timeoutremove <peer_id>ban <peer_id> --for <duration>unban <peer_id>score <peer_id> <score>export <path>/import <path> [--replace]connect <addr> [--peer-id ...] [--probe --timeout]disconnect <peer_id>show <peer_id>to print JSON details All commands accept the common--storeflag fromadd_common_store_arg(default~/.animica/p2p/peers.json). 【F:p2p/cli/peer.py†L513-L592】
animica-p2p listen
Start a standalone P2P node wired to the local database. Key flags: --db (SQLite URI), --chain-id, repeatable --listen/--seed multiaddrs, --enable-quic, --enable-ws, --nat, and --log-level.
【F:p2p/cli/listen.py†L196-L210】
Bootstrap seeds: by default the node uses ANIMICA_P2P_SEEDS (comma-separated multiaddrs), and ops/run.sh now populates this from ops/seeds/<profile>.json while also inserting those seeds into ~/.animica/p2p/peers.json. Setting ANIMICA_P2P_SEEDS="" disables the defaults; providing a list replaces them for both the CLI and the peer store helpers.
animica-p2p publish
Publish a single payload to a gossip topic using a lightweight P2P node. Required topic/payload flags include --topic plus one of --hex, --file, or --json. Connectivity flags mirror the listener (--chain-id, --seed, --listen, --enable-quic, --enable-ws, --log-level). Payload handling extras: --encode {raw,cbor,json}, --dry-run, and --linger to wait after publish.
【F:p2p/cli/publish.py†L64-L83】
Templates engine
templates-engine
Unified interface for working with repository templates:
listenumerates available templates undertemplates/validate --template/-t <path|name> [--print] [--strict]with optional variable sources via--vars,--var KEY=VAL,--vars-json, or--env-prefixrender --template/-t <path|name> --out/-o <dir> [--dry-run] [--force] [--exclude GLOB ...] [--print]plus the same variable-loading options 【F:templates/engine/cli.py†L503-L538】
SDK code generation
sdk.codegen.cli
Generate contract client stubs from a normalized ABI IR. Invoke as python -m sdk.codegen.cli with:
--lang {py,ts,rs}target--abi PATH|-input ABI JSON--out DIRdestination directory- Optional
--classname and--filefilename - Advanced overrides for base imports/classes per language (
--py-base-import,--ts-base-class, etc.) 【F:sdk/codegen/cli.py†L388-L402】
Studio Services admin
python -m studio_services.cli
Administrative Typer app with shared --config/-c option. Commands:
migrateapply database migrations/init schemacreate-api-keygenerate/store or print an API key (--name,--scopes,--print-only)list-api-keysshow stored keys (redacted)revoke-api-key <id>soft-delete a keyqueue-statsprint verification queue countersbackfillrecompute missing artifacts/verifications (--artifacts/--verifications,--dry-run)gcgarbage-collect orphaned artifacts (--days,--dry-run) 【F:studio-services/studio_services/cli.py†L92-L146】【F:studio-services/studio_services/cli.py†L183-L338】
Core sanity helper
python -m core.cli_demo
Lightweight helper to print chain parameters and the current head pointer. Flags: --db (database URI), --genesis (path to genesis JSON), and --log level.
【F:core/cli_demo.py†L4-L64】
Node pipeline shim
python -m aicf.cli.node_pipeline
Bitcoin-style control surface for the lightweight aicf.node RPC shim. Commands share a common --rpc-url/-r endpoint flag (defaults to http://127.0.0.1:8545 and automatically POSTs to /rpc), support JSON output via --json, and accept --datadir/-d to operate directly on a local state directory without RPC calls. Examples:
python -m aicf.cli.node_pipeline status --json
python -m aicf.cli.node_pipeline mine --count 1 --rpc-url http://127.0.0.1:8545
python -m aicf.cli.node_pipeline block latest --json
python -m aicf.cli.node_pipeline auto true --datadir /tmp/node
python -m aicf.cli.node_pipeline pipeline -m 2 --rpc-url http://127.0.0.1:8545
For devnet, the RPC server and core tools share the same SQLite DB and genesis. Once the node is running via ops/run.sh node, y
ou can:
# check status (expects chainId 1337 on devnet, height 0 before mining)
python -m aicf.cli.node_pipeline status \
--rpc-url http://127.0.0.1:8545/rpc
# mine 3 blocks via RPC (prints "3" on success)
python -m aicf.cli.node_pipeline mine \
--count 3 \
--rpc-url http://127.0.0.1:8545/rpc
# status now reports height=3 as well
python -m aicf.cli.node_pipeline status \
--rpc-url http://127.0.0.1:8545/rpc
# verify the chain state directly from core (head height 3)
python -m core.cli_demo \
--db "sqlite:////$HOME/animica/devnet/chain.db" \
--genesis genesis/devnet.json
status [--json]prints chain ID, head height, and whether auto-mining is enabled.mine --count/-n <blocks>bumps the chain height by the requested number of blocks (RPC via miner endpoints or local datadir).block <tag|number> [--json]fetches a block by number or tag (latest,earliest, or hex tags) using RPC or local state.auto <true|false>toggles the miner start/stop RPCs (or flips the localauto_mineflag when--datadiris used) and printson/off.pipeline [--mine/-m <blocks>] [--wait <seconds>] [--json]runs a scripted workflow of status → mining → head fetch to validate the node surface in one go against either backend. 【F:aicf/cli/node_pipeline.py†L1-L210】
This page mirrors a file in the animicaorg/all repository. If the repository and this page ever disagree, the repository is authoritative. For long-form explainers written for newcomers, see Learn.