OverviewFilesCommitsIssuesDocsReleasesPeers

hyperswarm-peer commits / e4b70e5

docs: step 5 is done — mark it, and show how to use it
swarmd/README.md gains the ten lines a consumer actually needs, and the warning that goes with them: do not write the wire yourself, because both clients that did were wrong. SWARMD-DESIGN §9 step 5 and §7 item 7 are marked done. Step 6 — porting the Blender addon and retiring session-daemon — is now unblocked on everything except a machine with Blender on it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
e4b70e5eddb21a7e42812a70c312d5fb13659f60
by plankatron <fleeky@gmail.com> · 2026-09-10T22:10:37.000Z

Changed files (2) +24 -4

docs/SWARMD-DESIGN.md +3 -3
……@@ -119,8 +119,8 @@ content directory, which is also what makes a fetch resumable across restarts.
1191194. client ids and app identity, for echo suppression and membership later
1201205. a stable transport identity (a stored seed, not a fresh keypair per start)
1211216. discoverability — register the socket by name, as pgh-sidecar's `app-lookup` does
1227. a C++ client library. "Any program in C++" is the goal; today the only client
123 is Python
1227. ✅ a C++ client library — `swarmd/client/client.h`. swarmd-probe is built on
123 it, and it is the only wire implementation a consumer should have
1241248. Zig-built, pgh-published multi-arch. A plain g++ build will not load on ashatron
125125
126126## 8. Gates — all headless, no Blender, no Godot
……@@ -145,7 +145,7 @@ the products never use.
1451452. ✅ define the schema; generate structs (`hyperschema-c`) and RPC (`hrpc-c`)
1461463. ✅ the daemon skeleton: threads, UDS, per-client buffering (§4)
1471474. ✅ control plane, then channels, then content
1485. ⏳ the C++ client library
1485. ✅ the C++ client library — `swarmd/client/`, 28/28
1491496. ⏳ port the Blender addon off `session-daemon`, and retire it
150150
151151### 9.1 What step 6 actually is (2026-09-10)
swarmd/README.md +21 -1
……@@ -22,6 +22,24 @@ encodings the same way, with `schema/build.js` and the resulting
2222- **hyperschema-c** — structs + `preencode/encode/decode/destroy(compact_state_t*)`
2323- **hrpc-c** — typed sans-io RPC over the bare-rpc wire (unary + event handlers)
2424
25## Using it from C++
26
27 #include "client/client.h"
28
29 swarmd::Client c;
30 c.on.on_message = [](uint64_t ch, uint64_t slot, uint64_t kind, uint64_t who,
31 const uint8_t *b, size_t n) { /* ... */ };
32 c.connect("/tmp/s.sock", "my-app");
33 c.join(topic);
34 const uint64_t ch = c.open_channel("my-app/v1", {}, 2);
35 while (running) {
36 c.send(ch, 0, 0, bytes, len); // false = nobody has it open yet, retry
37 c.poll(200);
38 }
39
40⛔ Do not write the wire yourself. Two clients in this repo did, and both were
41wrong in ways the daemon could not distinguish from a bad daemon.
42
2543## Links against
2644
2745- **libcompact** — compact-encoding in C, ABI-identical to the JS codec
……@@ -34,6 +52,7 @@ encodings the same way, with `schema/build.js` and the resulting
3452 ./test/test_uds_backpressure
3553 ./test/test_control
3654 ./test/test_send_truth
55 ./test/test_client
3756
3857## Status
3958
……@@ -44,7 +63,8 @@ encodings the same way, with `schema/build.js` and the resulting
4463 daemon UdxTransport + queue + control plane runs
4564 channels Protomux channel per peer, SEND/on-message D1/D4 PASS
4665 content liboverlay: hash/serve/fetch/cancel D6 PASS
47 tools/ swarmd-probe — the smallest real client
66 client/ swarmd::Client — the ONE wire implementation 28/28
67 tools/ swarmd-probe — built on it, in 181 lines
4868
4969 ./swarmd --socket /tmp/s.sock --storage ~/.swarmd # public DHT
5070 [swarmd] listening on /tmp/s.sock