@openvole/volenet 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,19 +8,29 @@ npm install @openvole/volenet
|
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
```ts
|
|
11
|
-
import { VoleNetManager, createEventBus
|
|
11
|
+
import { VoleNetManager, createEventBus } from '@openvole/volenet'
|
|
12
12
|
|
|
13
13
|
const bus = createEventBus()
|
|
14
|
-
|
|
14
|
+
// `room` is present when this arrived as a room post rather than a private message.
|
|
15
|
+
bus.on('volenet:chat', (m) => console.log(`${m.room ?? 'dm'} ${m.fromName}: ${m.text}`))
|
|
15
16
|
|
|
16
17
|
const net = new VoleNetManager(
|
|
17
18
|
{ enabled: true, instanceName: 'my-node', port: 9700, keyPath: './data/net/vole_key' },
|
|
18
19
|
'./data',
|
|
19
20
|
)
|
|
20
21
|
await net.start(undefined, bus)
|
|
22
|
+
|
|
21
23
|
await net.sendChat('some-peer', 'hello')
|
|
24
|
+
|
|
25
|
+
// A room, through a hub that reads none of it (§7c).
|
|
26
|
+
await net.roomCommand('my-hub', 'room:create', { name: 'valley' })
|
|
27
|
+
const [room] = net.getRooms()
|
|
28
|
+
await net.postToRoom(room.room, 'morning') // → { sent, held, skipped }
|
|
22
29
|
```
|
|
23
30
|
|
|
31
|
+
An identity is generated on first start if `keyPath` has none. `generateKeyPair`, `trustPeer` and
|
|
32
|
+
the rest are exported for anything that manages keys itself.
|
|
33
|
+
|
|
24
34
|
## What it gives you
|
|
25
35
|
|
|
26
36
|
- **Identity that is a keypair, not an account.** Hybrid Ed25519 + ML-DSA-65 signatures, so a
|
|
@@ -32,6 +42,10 @@ await net.sendChat('some-peer', 'hello')
|
|
|
32
42
|
- **Blind relay hubs.** A hub forwards ciphertext for peers that cannot dial each other and keeps
|
|
33
43
|
none of it. An undelivered message waits in the *sender's* outbox; the hub keeps a notice — who
|
|
34
44
|
tried, how often, when — and nothing more.
|
|
45
|
+
- **Rooms.** Several members in one conversation, each post sealed once per member — so there is no
|
|
46
|
+
room key, and removing somebody stops them reading by construction rather than by a rotation
|
|
47
|
+
anybody has to remember. Capped at 64 members, which is where sealing per member stops making
|
|
48
|
+
sense; it refuses there rather than getting quietly slow.
|
|
35
49
|
- **Consent.** Nothing is trusted because it connected. A peer is paired directly, or consented to
|
|
36
50
|
through a hub, before it can say anything to you.
|
|
37
51
|
- **Intermittent peers as a supported shape.** Senders hold what they could not deliver and flush
|
|
@@ -46,6 +60,7 @@ Three things a host may provide, and none of them are required:
|
|
|
46
60
|
| an `EventSink` to `start()` | every event this node raises | it runs silently; `createEventBus()` is there if you have no bus |
|
|
47
61
|
| a `ToolProvider` to `start()` | tools shareable with trusted peers | no tool sharing |
|
|
48
62
|
| `persistPeer` in the config | peers learned at runtime survive a restart | they are live-only |
|
|
63
|
+
| `persistPeerEntry` in the config | a peer named by identity survives too — the only way to record one with no address | live-only |
|
|
49
64
|
|
|
50
65
|
`setLoggerFactory()` redirects the library's logging into your own logger. Left alone it writes to
|
|
51
66
|
`VOLE_LOG_FILE` when that is set, and is silent otherwise.
|
|
@@ -71,5 +86,5 @@ are referenced from the Rust client's source.
|
|
|
71
86
|
pnpm -C src/volenet test
|
|
72
87
|
```
|
|
73
88
|
|
|
74
|
-
|
|
75
|
-
byte-level interop with the Rust client.
|
|
89
|
+
213 tests, including end-to-end pairing, relay with consent, held messages, rooms across a
|
|
90
|
+
three-node mesh, file transfer, and byte-level interop with the Rust client.
|
package/package.json
CHANGED