blockscout-openapi-skill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Blockscout Explorer API Skill

Blockscout Explorer API 技能

Use this skill to run Blockscout explorer operations through
uxc
+ OpenAPI.
Reuse the
uxc
skill for shared execution, auth, and error-handling guidance.
使用此技能通过
uxc
+ OpenAPI 运行Blockscout浏览器操作。
复用
uxc
技能以获取共享的执行、认证和错误处理指引。

Prerequisites

前提条件

  • uxc
    is installed and available in
    PATH
    .
  • Network access to a Blockscout deployment that exposes
    /api/v2
    .
  • Access to the curated OpenAPI schema URL:
    • https://raw.githubusercontent.com/holon-run/uxc/main/skills/blockscout-openapi-skill/references/blockscout-v2.openapi.json
  • A target Blockscout instance. Examples in this skill use
    https://eth.blockscout.com/api/v2
    .
  • uxc
    已安装且可在
    PATH
    中访问。
  • 能够访问暴露
    /api/v2
    的Blockscout部署节点。
  • 能够访问精心整理的OpenAPI schema URL:
    • https://raw.githubusercontent.com/holon-run/uxc/main/skills/blockscout-openapi-skill/references/blockscout-v2.openapi.json
  • 一个目标Blockscout实例。本技能中的示例使用
    https://eth.blockscout.com/api/v2

Scope

适用范围

This skill covers a read-first explorer surface:
  • address summary lookup
  • address token balances
  • address transaction history
  • token metadata
  • token holder reads
  • transaction detail lookup
  • block detail lookup
This skill does not cover:
  • Blockscout GraphQL
  • raw JSON-RPC proxying
  • write operations or admin/configuration flows
  • custom authenticated gateways beyond what the caller explicitly binds
本技能覆盖以只读为主的浏览器功能:
  • 地址摘要查询
  • 地址代币余额
  • 地址交易历史
  • 代币元数据
  • 代币持有者信息读取
  • 交易详情查询
  • 区块详情查询
本技能覆盖:
  • Blockscout GraphQL
  • 原始JSON-RPC代理
  • 写入操作或管理员/配置流程
  • 调用方未显式绑定的自定义认证网关

Authentication

认证

Public Blockscout instances usually allow explorer reads without auth.
If you are targeting a self-hosted or gateway-protected instance, configure auth separately with standard
uxc auth
bindings for that host. This skill does not assume any default credential.
公开的Blockscout实例通常允许无需认证的浏览器读取操作。
如果目标是自托管或网关保护的实例,请使用标准的
uxc auth
绑定为该主机单独配置认证。本技能不预设任何默认凭证。

Core Workflow

核心工作流程

  1. Use the fixed link command by default:
    • command -v blockscout-openapi-cli
    • If missing, create it:
      uxc link blockscout-openapi-cli https://eth.blockscout.com/api/v2 --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/blockscout-openapi-skill/references/blockscout-v2.openapi.json
    • blockscout-openapi-cli -h
  2. Inspect operation schema first:
    • blockscout-openapi-cli get:/addresses/{address_hash} -h
    • blockscout-openapi-cli get:/tokens/{address_hash} -h
    • blockscout-openapi-cli get:/transactions/{hash} -h
  3. Prefer narrow lookup validation before larger history reads:
    • blockscout-openapi-cli get:/blocks/{block_number_or_hash} block_number_or_hash=latest
    • blockscout-openapi-cli get:/addresses/{address_hash} address_hash=0xd8da6bf26964af9d7eed9e03e53415d37aa96045
    • blockscout-openapi-cli get:/tokens/{address_hash} address_hash=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
  4. Execute with key/value parameters:
    • blockscout-openapi-cli get:/addresses/{address_hash}/transactions address_hash=0xd8da6bf26964af9d7eed9e03e53415d37aa96045
    • blockscout-openapi-cli get:/tokens/{address_hash}/holders address_hash=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
  1. 默认使用固定链接命令:
    • command -v blockscout-openapi-cli
    • 如果不存在,创建链接:
      uxc link blockscout-openapi-cli https://eth.blockscout.com/api/v2 --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/blockscout-openapi-skill/references/blockscout-v2.openapi.json
    • blockscout-openapi-cli -h
  2. 先检查操作schema:
    • blockscout-openapi-cli get:/addresses/{address_hash} -h
    • blockscout-openapi-cli get:/tokens/{address_hash} -h
    • blockscout-openapi-cli get:/transactions/{hash} -h
  3. 在进行大量历史数据读取前,优先进行窄范围查询验证:
    • blockscout-openapi-cli get:/blocks/{block_number_or_hash} block_number_or_hash=latest
    • blockscout-openapi-cli get:/addresses/{address_hash} address_hash=0xd8da6bf26964af9d7eed9e03e53415d37aa96045
    • blockscout-openapi-cli get:/tokens/{address_hash} address_hash=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
  4. 使用键值参数执行操作:
    • blockscout-openapi-cli get:/addresses/{address_hash}/transactions address_hash=0xd8da6bf26964af9d7eed9e03e53415d37aa96045
    • blockscout-openapi-cli get:/tokens/{address_hash}/holders address_hash=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

Operation Groups

操作分组

Address Reads

地址读取

  • get:/addresses/{address_hash}
  • get:/addresses/{address_hash}/token-balances
  • get:/addresses/{address_hash}/transactions
  • get:/addresses/{address_hash}
  • get:/addresses/{address_hash}/token-balances
  • get:/addresses/{address_hash}/transactions

Token, Transaction, And Block Reads

代币、交易与区块读取

  • get:/tokens/{address_hash}
  • get:/tokens/{address_hash}/holders
  • get:/transactions/{hash}
  • get:/blocks/{block_number_or_hash}
  • get:/tokens/{address_hash}
  • get:/tokens/{address_hash}/holders
  • get:/transactions/{hash}
  • get:/blocks/{block_number_or_hash}

Multi-Instance Use

多实例使用

To target a different Blockscout deployment, keep the same schema and relink the command to another host that serves
/api/v2
:
bash
uxc link blockscout-openapi-cli https://optimism.blockscout.com/api/v2 \
  --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/blockscout-openapi-skill/references/blockscout-v2.openapi.json
要针对不同的Blockscout部署节点,保持相同的schema并将命令重新链接到另一个提供
/api/v2
的主机:
bash
uxc link blockscout-openapi-cli https://optimism.blockscout.com/api/v2 \
  --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/blockscout-openapi-skill/references/blockscout-v2.openapi.json

Guardrails

防护规则

  • Keep automation on the JSON output envelope; do not use
    --text
    .
  • Parse stable fields first:
    ok
    ,
    kind
    ,
    protocol
    ,
    data
    ,
    error
    .
  • Treat this v1 skill as read-only. Do not imply transaction broadcast or contract write support.
  • This schema is designed for Blockscout deployments that expose the explorer REST surface at
    /api/v2
    . If host help fails, check the deployment path before assuming a protocol mismatch.
  • Pagination and filter options vary across deployments. Start with host help and operation help on the target instance before building large crawls.
  • blockscout-openapi-cli <operation> ...
    is equivalent to
    uxc <blockscout_api_v2_host> --schema-url <blockscout_openapi_schema> <operation> ...
    .
  • 自动化操作基于JSON输出包,请勿使用
    --text
    参数。
  • 优先解析稳定字段:
    ok
    ,
    kind
    ,
    protocol
    ,
    data
    ,
    error
  • 将此v1版本技能视为只读工具。请勿假设它支持交易广播或合约写入操作。
  • 该schema专为在
    /api/v2
    暴露浏览器REST接口的Blockscout部署节点设计。如果主机帮助失效,请先检查部署路径,再假设存在协议不匹配问题。
  • 分页和过滤选项因部署节点而异。在构建大规模爬取任务前,请先查看目标实例的主机帮助和操作帮助。
  • blockscout-openapi-cli <operation> ...
    等同于
    uxc <blockscout_api_v2_host> --schema-url <blockscout_openapi_schema> <operation> ...

References

参考资料