From 74a5da9a6644ea49cdcfaea5cae8312f4becd4e4 Mon Sep 17 00:00:00 2001 From: Nic Dorman Date: Wed, 13 May 2026 17:26:39 +0000 Subject: [PATCH] fix(ant-dev): tooling cluster - flag alias, sys.executable, anvil preflight, README Three small but user-visible papercuts that tripped up first-run setup: - #62: README documented --autonomi-dir but the CLI only accepted --ant-node-dir, so the literal command in the docs failed. Update the README to show --ant-node-dir, and accept --autonomi-dir as a back- compat alias so older scripts/blog-posts keep working without a deprecation period. - #63: ant dev example -l python shelled out to "python3" from PATH instead of sys.executable. Under PEP 668 distros (Ubuntu 24.04) where ant-dev has to live in a venv, the venv s python3 has antd installed and the system one does not, so the example fataled with ModuleNotFoundError. Use sys.executable, which is always the same interpreter that imported ant-dev. - #64: ant dev start needs anvil (Foundry) for the EVM testnet but neither the README nor any error message said so. The user only saw "Timed out waiting for devnet manifest". Add a shutil.which preflight with a clear install hint, and mention Foundry in the Required prerequisites section of the README. Closes #62, #63, #64 --- README.md | 3 ++- ant-dev/src/ant_dev/cli.py | 4 +++- ant-dev/src/ant_dev/cmd_example.py | 6 +++--- ant-dev/src/ant_dev/cmd_start.py | 9 +++++++++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8f1c3c1..47f57b5 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,7 @@ All data and file upload operations accept an optional `payment_mode` parameter - **Rust** toolchain — for building antd - **Python 3.10+** — for the dev CLI (`ant-dev`) and MCP server - **ant-node** repo cloned as sibling (for local testnet only): `git clone https://github.com/WithAutonomi/ant-node ../ant-node` +- **Foundry** (provides `anvil`) — for the local EVM testnet that the devnet spawns: `curl -sL https://foundry.paradigm.xyz | bash && foundryup` **Language-specific** (install only what you need): @@ -428,7 +429,7 @@ The Autonomi network provides these core primitives, all accessible through the ## Developer CLI Reference ``` -ant dev start [--autonomi-dir PATH] [--no-build] # Start local environment +ant dev start [--ant-node-dir PATH] [--no-build] # Start local environment ant dev stop # Tear down everything ant dev status # Show running processes + health ant dev example [-l python|csharp] # Run named example diff --git a/ant-dev/src/ant_dev/cli.py b/ant-dev/src/ant_dev/cli.py index 1c1e4bd..1a19bba 100644 --- a/ant-dev/src/ant_dev/cli.py +++ b/ant-dev/src/ant_dev/cli.py @@ -19,7 +19,9 @@ def main(argv: list[str] | None = None) -> None: # ant dev start p = dev_sub.add_parser("start", help="Start ant devnet + antd") - p.add_argument("--ant-node-dir", help="Path to ant-node repo") + # --autonomi-dir kept as a back-compat alias for older docs/scripts (#62). + p.add_argument("--ant-node-dir", "--autonomi-dir", dest="ant_node_dir", + help="Path to ant-node repo") p.add_argument("--no-build", action="store_true", help="Skip build (use existing binaries)") p.add_argument("--enable-evm", action="store_true", help="Enable EVM payment enforcement") diff --git a/ant-dev/src/ant_dev/cmd_example.py b/ant-dev/src/ant_dev/cmd_example.py index 3c17e22..9cb2e97 100644 --- a/ant-dev/src/ant_dev/cmd_example.py +++ b/ant-dev/src/ant_dev/cmd_example.py @@ -66,9 +66,9 @@ def _run_one_python(script: Path) -> None: print(f"Example file not found: {script}") sys.exit(1) - # Use 'python' on Windows, 'python3' on Unix - python = "python" if sys.platform == "win32" else "python3" - result = subprocess.run([python, str(script)]) + # Use the interpreter that runs ant-dev itself; in editable installs + # that points at the venv where antd[rest] is on sys.path (#63). + result = subprocess.run([sys.executable, str(script)]) if result.returncode != 0: sys.exit(result.returncode) diff --git a/ant-dev/src/ant_dev/cmd_start.py b/ant-dev/src/ant_dev/cmd_start.py index a081d0f..5870b2c 100644 --- a/ant-dev/src/ant_dev/cmd_start.py +++ b/ant-dev/src/ant_dev/cmd_start.py @@ -8,6 +8,7 @@ import json import os +import shutil import sys import time from pathlib import Path @@ -73,6 +74,14 @@ def run(args) -> None: print() # ── 1. Start ant-devnet ── + # Preflight: ant-devnet spawns anvil (Foundry) for the EVM testnet (#64). + # Without anvil on PATH the devnet times out with an unhelpful error. + if shutil.which("anvil") is None: + print(red(" ERROR: anvil (from Foundry) not found on PATH.")) + print(gray(" ant-devnet needs anvil for the local EVM testnet.")) + print(gray(" Install: curl -sL https://foundry.paradigm.xyz | bash && foundryup")) + sys.exit(1) + print(yellow("[1/3] Starting ant devnet...")) devnet_cmd = [