Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 发现公开端点
Expand Down
Loading