Skip to content
Open
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
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,26 @@ jobs:
- name: Run Rust tests
run: cargo test --manifest-path engram-core/Cargo.toml --no-default-features

# ── OpenAPI spec validation ───────────────────────────────────────────────────
openapi-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install spectral
run: npm install -g @stoplight/spectral-cli

- name: Validate OpenAPI spec
run: |
spectral lint docs/openapi.yaml --ruleset spectral:oas
echo "OpenAPI spec valid"

# ── Build wheel smoke-test ────────────────────────────────────────────────────
build-wheel:
runs-on: ubuntu-latest
Expand Down
16 changes: 16 additions & 0 deletions docs/api-reference.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<title>Engram Miner HTTP API — Reference</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🧠</text></svg>">
<style>
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
</style>
</head>
<body>
<redoc spec-url='openapi.yaml'></redoc>
<script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"></script>
</body>
</html>
17 changes: 17 additions & 0 deletions docs/miner.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,20 @@ curl http://localhost:8091/stats
**Proof challenges failing**
- Check miner logs for `Challenge error:` messages.
- Ensure system clock is synced (`timedatectl status`)

---

## API Reference

**OpenAPI 3 Specification**: [`docs/openapi.yaml`](openapi.yaml)

**Interactive API Reference (Redoc)**: [`docs/api-reference.html`](api-reference.html)

The API reference documents all HTTP endpoints served by the miner on port 8091:
- Public endpoints: `/health`, `/stats`, `/metagraph`
- Authenticated endpoints: `/IngestSynapse`, `/QuerySynapse`, `/ChallengeSynapse`, `/retrieve/{cid}`
- Namespace & key management: `/namespace`, `/AttestNamespace`, `/attestation/{namespace}`, `/KeyShareSynapse`, `/KeyShareRetrieve`
- Repair & replication: `/RepairSynapse`, `/list`
- Merkle proofs: `/commitment`, `/prove-memory`

All mutating endpoints require sr25519 signed requests with `hotkey`, `nonce` (unix ms), and `signature` fields in the JSON body.
Loading