From 960b7e4838d76bcd3d77caa5a8c877874b59a228 Mon Sep 17 00:00:00 2001 From: BlockVectra <5194435+gjwang@users.noreply.github.com> Date: Sun, 8 Nov 2026 01:30:32 +0800 Subject: [PATCH] docs: run the public chain reader without cloning --- README.md | 8 ++++++++ README.zh.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 0f83897..e3754c9 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,14 @@ python3 examples/public_chain.py python3 examples/public_chain.py 56 # Select a chain from the live directory ``` +With [uv](https://docs.astral.sh/uv/) installed, you can run the pinned script without cloning. This command selects Mode mainnet: + +```bash +uv run --no-project --script --python 3.11 https://raw.githubusercontent.com/blockvectra/agent-quickstart/0df68765d6706a4df88aee469dfb4fd07beeef89/examples/public_chain.py 34443 +``` + +A successful check prints `{"chain":"mode_mainnet","chainId":34443}`. Replace the final argument with another chain ID from the live directory, or omit it for Robinhood mainnet. uv downloads the script and may provision Python 3.11 if needed; the script itself uses only the Python standard library. + The script makes at most two serial HTTP requests: it selects the chain from the public directory, then verifies `eth_chainId` against that selection. It checks chain identity, not the latest block or method coverage. It never retries automatically. Each socket operation has a 15-second timeout; this is a socket timeout, not a hard deadline for DNS or the full request. ### Discover public endpoints with evmchains diff --git a/README.zh.md b/README.zh.md index 89647db..f364699 100644 --- a/README.zh.md +++ b/README.zh.md @@ -80,6 +80,14 @@ python3 examples/public_chain.py python3 examples/public_chain.py 56 # 从实时目录选择链 ``` +已安装 [uv](https://docs.astral.sh/uv/) 时,可以不克隆仓库,直接运行固定源码版本的脚本。以下命令选择 Mode 主网: + +```bash +uv run --no-project --script --python 3.11 https://raw.githubusercontent.com/blockvectra/agent-quickstart/0df68765d6706a4df88aee469dfb4fd07beeef89/examples/public_chain.py 34443 +``` + +校验成功时输出 `{"chain":"mode_mainnet","chainId":34443}`。将末尾参数改为实时目录中的其他 chain ID 即可换链,省略则选择 Robinhood 主网。uv 会下载脚本,必要时准备 Python 3.11;脚本本身只使用 Python 标准库。 + 脚本最多串行发送两次 HTTP 请求:先从公开目录选择链,再核对 `eth_chainId` 是否与所选链一致。它验证的是链身份,不读取最新区块,也不验证方法覆盖情况。失败时不会自动重试。每次 socket 操作的超时为 15 秒;这不是 DNS 或整个请求流程的硬截止时间。 ### 通过 evmchains 发现公开端点