stoa/docs/INTEGRATION.md
stoa 62398ea6ae feat: on-chain integration harness (anvil) + custom-chain support + docs
- StoaAgent accepts a full Chain override (enables local anvil runs)
- scripts/integration.ts deploys contracts via viem and exercises real skills end-to-end
- scripts/run-integration.sh orchestrates anvil + forge build + skill run (pnpm test:integration)
- docs/INTEGRATION.md; README/contracts/skill-library counts updated
2026-06-11 19:04:53 +03:00

36 lines
1.4 KiB
Markdown

# Integration testing
`scripts/run-integration.sh` proves the skills work against a **real chain** end-to-end. It:
1. builds the Foundry contracts,
2. starts a local **anvil** node,
3. deploys `StoaRegistry`, `StoaEscrow`, `SocialFeed`, and `TipJar` to it via viem (reading the
Foundry artifacts), and
4. runs the actual skills — `agent_identity`, `agent_escrow`, `reputation`, `social_post`,
`tip_send`, `tip_stats` — asserting each succeeds on-chain.
```bash
pnpm test:integration
```
## Requirements
- **Foundry with `anvil`** on your PATH (`foundryup` installs `forge`, `cast`, and `anvil`).
- Node ≥ 20 and the workspace installed (`pnpm install`).
The script uses anvil's well-known dev accounts (#0 and #1), so no funded keys or network access
are needed — it runs fully offline.
## What it validates
| Skill | Assertion |
|-------|-----------|
| `agent_identity` | register returns an id; resolve reads it back |
| `agent_escrow` | create locks funds; release pays the worker |
| `reputation` | a counterparty attestation increments the score |
| `social_post` | a post is written and retrievable |
| `tip_send` / `tip_stats` | a tip transfers and shows in stats |
The skill **handler code path is identical** to production against Pharos Atlantic — only the RPC
URL and chain id differ — so a green integration run is strong evidence the skills work on Pharos.