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
View File
@@ -83,3 +83,30 @@ interface TemporalEvent {
See `examples/basic-usage.js` and integration with other hyper-p2p-* modules.
All methods are production-ready with comprehensive error handling and Bare runtime safety.
## 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).
@@ -77,3 +77,9 @@ flowchart LR
- Metrics exposed for observability (inserts, queries, prunes, eventCount).
This architecture makes `hyper-p2p-temporal-index` a foundational building block for time-aware decentralized applications: IoT telemetry, audit logs, chat history, financial tick data, and agent memory in the Bare/Pear ecosystem.
### 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)