Files
dat-thang/docs/libcess.md
T
divorce b735900f2e 0.0.002
ddat interop with dat js
cable interop with cabal js
ddat's frontend = dat-thang
cable fe = cable-thang
dillo support based on cel's dillo-dat
bootstrap node
xplatform support

Signed-off-by: divo <418@cryspace.space>
2026-10-19 00:17:02 -04:00

63 lines
2.7 KiB
Markdown

# libcess
`libcess` is the Cesspool base used by both p2p applications:
```text
┌───────────┐
│ libcess │
│ UDP, peer │
│ discovery│
└─────┬─────┘
┌───────┴───────┐
┌────▼────┐ ┌────▼────┐
│ ddat/dat│ │ cable │
│ SLEEP │ │ Cabal │
│ archives│ │ rooms │
└─────────┘ └─────────┘
```
The package owns the UDP socket transport, Cesspool messages, bootstrap and
rendezvous client/server logic, peer/topic state, and its Ed25519 bootstrap
identity. It has no SLEEP, Dat, Cable, or JSON dependency. Dat and Cable link
the same `libcess.a` so a configured `NETWORK_PROTOCOL` selects one discovery
network for both applications. The protocol token is data in the root
`NETWORK_PROTOCOL` file for the full project; a standalone libcess build reads
`libcess/NETWORK_PROTOCOL`.
## Standalone build
From the project root:
```sh
make -C libcess
make -C libcess install PREFIX="$HOME/.local"
```
This builds `libcess/build/libcess.a` and `libcess/build/cesspool-bootstrap`.
Only a C99 compiler, GNU make, and libsodium development files are required.
The bootstrap executable links only libcess, libsodium, and the platform UDP
socket library; it does not need libcurl or the Dat application library.
Apps including `cesspool.h` and `cess_net.h` link `libcess.a` after their own
static archive, then link libsodium. The installed headers are under
`include/libcess/`.
## Bootstrap node
`cesspool-bootstrap` is the bootstrap service shipped with the library. It
tracks topic announcements and returns peer endpoints; archive and chat data
still travels between peers. The process must stay running and its chosen UDP
port must be reachable from clients. `--advertise HOST:PORT` prints the
externally reachable address; the tool does not call an outside IP lookup
service. Configure that address in `ddat` or `cable` settings on each client.
The default identity location used by the integrated application is
`dat-gpt/cesspool-bootstrap-state/identity.key` under the platform's state
directory. The raw 96-byte public-plus-secret Ed25519 keypair matches the
existing bootstrap identity file layout, so extracting the library keeps a
running node's identity stable.
The old `dat_peer_t`, `datnet_t`, and `datnet_*` spellings remain as thin
source-compatibility aliases in the main application headers. New Cesspool
consumers should use `cess_peer_t`, `cessnet_t`, and `cessnet_*`.