taubyte-local-host-launch

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Local Host Launch

本地主机启动

When to use

使用场景

Use this skill after domain/resource creation in Dream/local when the goal is to:
  • access website/function endpoints by FQDN
  • open resources in browser using hostnames
  • validate host-based routing
当在Dream/本地环境中创建域名/资源后,若需要完成以下目标,可使用本Skill:
  • 通过FQDN访问网站/函数端点
  • 使用主机名在浏览器中打开资源
  • 验证基于主机的路由

Prerequisites

前置条件

  • taubyte-dream-local-operations
  • taubyte-hosts-file-editor
  • taubyte-dream-local-operations
  • taubyte-hosts-file-editor

Steps

步骤

  1. Confirm Dream and universe are running:
    bash
    dream status universe default
  2. Get FQDN(s) from domain resources:
    bash
    tau query domain --name <domain-name>
  3. Ensure hosts mappings exist for each FQDN:
    • 127.0.0.1 <fqdn>
    • run
      taubyte-hosts-file-editor
      automatically (do not wait for user prompt)
  4. Ensure local deploy trigger is executed for Dream/local:
    bash
    docker info
    dream inject push-all --universe default
    • if
      docker info
      fails, stop and report Docker as runtime blocker
  5. Discover serving port:
    • Usually from substrate:
      bash
      dream status substrate
    • If gateway is used in the universe, use its HTTP port from
      dream status universe <name>
      .
  6. Validate by hostname:
    bash
    curl "http://<fqdn>:<port>/<path>"
  7. If hosts edit is not available, fallback validation:
    bash
    curl --resolve "<fqdn>:<port>:127.0.0.1" "http://<fqdn>:<port>/<path>"
  8. For browser launch:
    • open
      http://<fqdn>:<port>/<path>
  1. 确认Dream和universe正在运行:
    bash
    dream status universe default
  2. 从域名资源中获取FQDN:
    bash
    tau query domain --name <domain-name>
  3. 确保每个FQDN都存在hosts映射:
    • 127.0.0.1 <fqdn>
    • 自动运行
      taubyte-hosts-file-editor
      (无需等待用户提示)
  4. 确保为Dream/本地环境执行了本地部署触发命令:
    bash
    docker info
    dream inject push-all --universe default
    • docker info
      执行失败,停止操作并报告Docker是运行时障碍
  5. 发现服务端口:
    • 通常从substrate获取:
      bash
      dream status substrate
    • 若universe中使用了网关,则从
      dream status universe <name>
      获取其HTTP端口。
  6. 通过主机名验证:
    bash
    curl "http://<fqdn>:<port>/<path>"
  7. 若无法编辑hosts,使用备用验证方式:
    bash
    curl --resolve "<fqdn>:<port>:127.0.0.1" "http://<fqdn>:<port>/<path>"
  8. 浏览器启动方式:
    • 打开
      http://<fqdn>:<port>/<path>

Output contract

输出约定

  • Always return:
    • exact website URL(s),
    • exact function URL(s),
    • one ready-to-run curl per endpoint,
    • whether hosts mapping was auto-applied or requires manual admin edit.
  • 始终返回:
    • 准确的网站URL(s),
    • 准确的函数URL(s),
    • 每个端点对应的可直接运行的curl命令,
    • 说明hosts映射是自动应用还是需要手动管理员编辑。

Notes

注意事项

  • Hosts mappings are OS-level and affect browser resolution.
  • curl --resolve
    is request-scoped and does not modify system DNS.
  • For HTTPS tests, prefer
    --resolve
    so hostname/SNI stays correct.
  • Do not introduce
    --generated-fqdn-prefix
    unless the user explicitly asks for a prefix.
  • If a function was created with
    --template empty
    , ensure
    empty.go
    is implemented before launching local tests.
  • Hosts映射是操作系统级别的,会影响浏览器的域名解析。
  • curl --resolve
    仅作用于当前请求,不会修改系统DNS。
  • 对于HTTPS测试,优先使用
    --resolve
    以保证主机名/SNI正确。
  • 除非用户明确要求前缀,否则不要引入
    --generated-fqdn-prefix
  • 若函数是使用
    --template empty
    创建的,需确保
    empty.go
    已实现,再启动本地测试。