This commit is contained in:
Raven Scott
2026-05-20 17:13:51 -04:00
parent 3507e4e91a
commit 7f086aa591
190 changed files with 34732 additions and 746 deletions
+27 -1
View File
@@ -172,4 +172,30 @@ All async methods reject on fatal errors (storage, swarm). Non-fatal issues are
---
*Complete API surface for the first production-grade intent routing primitive in the Bare ecosystem.*
*Complete API surface for the first production-grade intent routing primitive in the Bare ecosystem.*
## P2P and runtime options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `topic` | `string` \| `Buffer` | `null` | Hyperswarm discovery topic. Hex (64 chars) or string (hashed via `hypercore-crypto`). P2P is active when set. |
| `keyPair` | `KeyPair` | random | Ed25519 key pair (`hypercore-crypto.keyPair()`). |
### Runtime flags (test exit)
| Option | Modules | Default | Description |
|--------|---------|---------|-------------|
| `enableBackgroundTimers` | oracle, reputation | `false` | Enables periodic cleanup/decay/gossip timers. Keep `false` in unit tests so the process exits. |
| `enableGossip` | causal-consensus | `false` | Enables gossip interval + Protomux proposal fan-out when `topic` is also set. |
### Protomux
Wire format uses **Protomux v3** (`createChannel``addMessage``open`) via [`../_shared/p2p-bare.js`](../_shared/p2p-bare.js).
### Testing
```bash
npm install
npx brittle-bare test/test.js
```
Integration (2-node): [`../../real_tests/integration/`](../../real_tests/integration/) — see [DEVELOPMENT.md](../../DEVELOPMENT.md).
+6 -1
View File
@@ -151,4 +151,9 @@ flowchart TD
---
*This architecture was designed to be the foundational routing layer for next-generation intent-centric P2P applications on Bare/Pear.*
*This architecture was designed to be the foundational routing layer for next-generation intent-centric P2P applications on Bare/Pear.*
### Diagram legend (P2P)
- **Solid arrows** — implemented Hyperswarm / Protomux paths in `index.js`
- **Dashed arrows** — optional hooks (set `topic`, `enableGossip`, or pass external `hyperbee` / `swarm`)
- **Library-only** — no swarm required for core API (vector-clock, capabilities core)