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
@@ -82,4 +82,30 @@ All communication happens on a dedicated Protomux channel.
- `VALIDATION_ERROR`
- `STREAM_ERROR`
*Full examples in examples/ folder*
*Full examples in examples/ folder*
## 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
@@ -71,4 +71,9 @@ This module is the first to combine:
- Pluggable signing from hyper-p2p-presence
- Production patterns (graceful close, metrics hooks)
*Autonomous development - 2026-05-20*
*Autonomous development - 2026-05-20*
### 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)