tildefriends/apps/cory/docs/ssb.md

41 lines
1.5 KiB
Markdown

# Secure Scuttlebutt from Scratch
[Back to index](#index)
This aims to be the missing reference for those who wish to create a Secure
Scuttlebutt client from scratch.
## Discovery
A good way to get started is to participate in local network discovery with a known working
client on the same network. The
[Scuttlebutt Programming Guide](https://ssbc.github.io/scuttlebutt-protocol-guide/#local-network)
is a good start, here, with a few things to note:
1. Some clients advertise multiple addresses separated by semicolons (`;`).
2. Some clients advertise alternative protocols than `shs` and use hostnames instead of
IPv4 addresses.
So be prepared to accept variations.
There also an undocumented "new" style of discovery message.
## Secret Handshake, Box Stream, and RPC Protocol
Now that two clients are aware of eachother, they need to complete a secret handshake.
The [programming guide](https://ssbc.github.io/scuttlebutt-protocol-guide/#handshake)
is once again a good reference.
The box stream and RPC protocol can both be implemented from the
[same documentation](https://ssbc.github.io/scuttlebutt-protocol-guide/#box-stream)
without surprises.
## Synchronizing Data
... `ebt.replicate` or `createHistoryStream` ...
## Rooms
TODO
## References
* [https://ssbc.github.io/scuttlebutt-protocol-guide/](https://ssbc.github.io/scuttlebutt-protocol-guide/)
* [https://dev.planetary.social/](https://dev.planetary.social/)
* [https://dev.scuttlebutt.nz/#/golang/?id=muxrpc-endpoints](https://dev.scuttlebutt.nz/#/golang/?id=muxrpc-endpoints)