后端测试
- 作者仓库星标 0
- 作者更新于 实时读取
- 作者仓库 skills-registry
- 领域
- 通用
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- Docker
- 底层运行要求
- Docker
- 文件与系统权限
-
- 只读
- 读取环境变量
- 允许写入 / 修改
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: localnet
description: >- Use when this capability is needed. Guide the user through starting and using the docker comp…
category: 通用
runtime: Docker
---
# localnet 输出预览
## PART A: 任务判断
- 适用问题:通用任务拆解、检查和交付。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Prerequisites / Choose Mode / Dev Mode (default, fast — fake proofs)”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于通用任务拆解、检查和交付,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Prerequisites / Choose Mode / Dev Mode (default, fast — fake proofs)”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、读取环境变量、写入/修改文件、会按任务需要访问外部网络、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、读取环境变量、写入/修改文件;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、读取环境变量、写入/修改文件。
先用一个小任务确认它会围绕“Prerequisites / Choose Mode / Dev Mode (default, fast — fake proofs)”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: localnet
description: >- Use when this capability is needed. Guide the user through starting and using the docker comp…
category: 通用
source: tomevault-io/skills-registry
---
# localnet
## 什么时候使用
- 把通用方向的常用动作沉淀成 Agent 可调用的技能 适合处理通用任务拆解、检查、交付和复盘,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;通常不需要额外…
- 面向通用任务拆解、检查和交付,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Prerequisites / Choose Mode / Dev Mode (default, fast — fake proofs)」组织步骤,不把推断写成作者事实。
- 读取文件、读取环境变量、写入/修改文件;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "localnet" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Prerequisites / Choose Mode / Dev Mode (default, fast — fake proofs)
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Docker | 读取文件、读取环境变量、写入/修改文件 | 会按任务需要访问外部网络
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Boundless Localnet
Guide the user through starting and using the docker compose-based localnet.
Prerequisites
Before starting, ensure:
- Docker is running
- Contracts and guest binaries are built:
forge build && cargo check - Guest ELF binaries exist at
target/riscv-guest/(built bycargo check)
Choose Mode
Ask the user which mode they want (default to dev mode):
Dev Mode (default, fast — fake proofs)
Uses RISC0_DEV_MODE=1. Proofs are faked so everything is instant. The broker runs as part of the docker compose cluster — no separate terminal needed. Best for testing request flow, contract interactions, and integration.
Full Proving Mode (real proofs, requires GPU or Bento cluster)
Uses RISC0_DEV_MODE=false. The broker is NOT included in the localnet cluster. Start it separately with just prover (Bento + broker). Requires a proving backend (local GPU or Bento cluster).
Starting Localnet
Dev Mode
Run just localnet in the foreground (not as a background task). It handles deploying contracts and starting all services — wait for it to complete before submitting requests. This avoids needing to poll container status while the deployer runs.
Explicitly set RISC0_DEV_MODE on the just localnet command to avoid inheriting a stale value from the terminal environment. Other commands don't need it — source .env.localnet sets it.
# Start the full localnet (anvil + postgres + minio + order-stream + broker)
# Run in foreground — wait for it to finish before proceeding
RISC0_DEV_MODE=1 just localnet
Submitting a test request
Submit in a background task, then monitor status through order-stream, on-chain, and broker logs while it waits for fulfillment.
For immediate broker acceptance, the offer's min-price must exceed the broker's minimum profitable price (gas costs + min_mcycle_price). On anvil, gas costs are ~0.00003 ETH, so 0.0001 ETH is safely above the threshold. The price starts at min-price before rampUpStart (defaults to now() + 30s), so setting min-price high enough means the broker accepts before the ramp even begins.
source .env.localnet && cargo run --example submit_echo -- \
--bidding-start "$(date +%s)" \
--min-price "0.0001 ETH" \
--max-price "0.0004 ETH"
Why these values:
--bidding-start "$(date +%s)": SetsrampUpStartto now. Without this, the default isnow() + 30s(DEFAULT_BASE_RAMP_UP_DELAY), which delays when the auction begins.--min-price "0.0001 ETH": Above broker's minimum profitable price (~0.00003 ETH gas on anvil). If min-price is too low, the broker schedules a delayed lock attempt and waits for the auction price to ramp up past its threshold.--max-price "0.0004 ETH": ~4x min-price, reasonable ceiling
Full Proving Mode
Explicitly set RISC0_DEV_MODE=false on the just localnet command to avoid inheriting a stale value from the terminal environment. Other commands don't need it — source .env.localnet sets it.
# Terminal 1: Start the localnet (anvil + postgres + minio + order-stream, NO broker)
RISC0_DEV_MODE=false just localnet
# Terminal 2: Start the prover cluster (Bento + broker)
source .env.localnet && just prover
# Terminal 3: Submit a test request
source .env.localnet && cargo run --example submit_echo -- \
--bidding-start "$(date +%s)" \
--min-price "0.0001 ETH" \
--max-price "0.0004 ETH"
Checking Order Status
After submitting a request, you'll see a request ID like:
Submitted request: 90f79bf6eb2c4f870365e785982e1f101e93b9061d289271
Query the order-stream
Note: the limit query parameter is required.
# List recent orders
curl -s "http://localhost:8585/api/v1/orders?limit=10" | jq .
# Query a specific order by request ID
curl -s "http://localhost:8585/api/v1/orders?request_id=<REQUEST_ID>&limit=10" | jq .
Check request status from broker logs
Use broker logs to extract the requestor-relevant milestones. The user cares about when the request was submitted, locked, and fulfilled, plus the fulfilled price — not the internal proving pipeline steps.
# Dev mode: broker runs in compose
docker compose -f dockerfiles/compose.localnet.yml --profile dev-broker logs broker 2>&1 | grep <REQUEST_ID>
Key log lines to look for:
Locked request <ID>— when the broker locked itCompleted order: <ID> eth_reward: <PRICE>— when it was fulfilled and at what price- The order's
created_atfield from the order-stream query shows submission time
Present status to the user as:
| Event | Time |
|---|---|
| Submitted | (from order-stream created_at) |
| Locked | (from broker log "Locked request") |
| Fulfilled | (from broker log "Completed order") |
Fulfilled price: (from eth_reward in the "Completed order" log line)
Check order-stream logs
docker compose -f dockerfiles/compose.localnet.yml logs order-stream
# Watch live
docker compose -f dockerfiles/compose.localnet.yml logs -f order-stream
Stopping
# Stop localnet (preserves anvil state for restart)
just localnet down
# Stop and wipe all state (fresh start)
just localnet clean
Troubleshooting
Request stuck at "Unknown"
- Check order-stream logs — did it receive the order?
- If
Broadcasted order ... to 0 clients, the broker isn't connected to the WebSocket - In dev mode, check broker container is running:
docker compose -f dockerfiles/compose.localnet.yml --profile dev-broker ps
Broker delays lock ("scheduled for lock attempt in Ns")
The broker waits until the auction price exceeds its minimum profitable price (gas costs + min_mcycle_price). To avoid this delay, set --min-price above the broker's gas cost threshold (~0.0001 ETH on anvil). The price sits at min-price before rampUpStart (default now() + 30s), so a sufficiently high min-price means instant acceptance.
Broker not picking up orders
- Check that
--min-priceis high enough to cover gas + min_mcycle_price - Check broker's
min_mcycle_priceinbroker.tomlvs the offer price
Price oracle errors on anvil
- Ensure
broker.tomlhas the[price_oracle]section with static prices and chainlink disabled.just localnetadds this automatically.
Port conflicts
- Localnet uses ports: 8545 (anvil), 8585 (order-stream), 5435 (postgres), 9100/9101 (minio)
- Check for conflicts:
ss -tlnp | grep -E '8545|8585|5435|9100'
Source: boundless-xyz/boundless — distributed by TomeVault.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核