https://github.com/stripedpajamas/sbotz
a simple (functional) scuttlebutt client in zig
https://github.com/stripedpajamas/sbotz
scuttlebutt secure-scuttlebutt ssb ziglang
Last synced: about 1 year ago
JSON representation
a simple (functional) scuttlebutt client in zig
- Host: GitHub
- URL: https://github.com/stripedpajamas/sbotz
- Owner: stripedpajamas
- License: gpl-3.0
- Created: 2020-12-19T23:25:42.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-09T00:31:12.000Z (over 5 years ago)
- Last Synced: 2025-04-01T19:06:52.779Z (about 1 year ago)
- Topics: scuttlebutt, secure-scuttlebutt, ssb, ziglang
- Language: Zig
- Homepage:
- Size: 81.1 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sbotz
a simplistic secure-scuttlebot client written in Zig
## use
1. install Zig (at time of writing, only works with master version of Zig)
1. clone repo `git clone https://github.com/stripedpajamas/sbotz.git && cd sbotz`
1. run the example: `zig run src/example.zig`. the example tries to connect to local ssb-server and calls `createLogStream`
the `src/example.zig` file shows how the client library could be used.
i don't really know how `build.zig` files work yet so there isn't one.
## what is it
i mostly just tried to implement what [the protocol guide](https://ssbc.github.io/scuttlebutt-protocol-guide) says.
- `shs.zig` implements the handshake / session key generation logic
- `box.zig` uses the SHS module to run the handshake and then wraps some reader/writer (e.g. socket)'s read/write methods with boxed versions
- `rpc.zig` wraps some reader/writer with the RPC stuff
- `client.zig` takes in a reader/writer (socket), uses box to orchestrate the handshake, and exposes `call` to make ssb calls to the other end (e.g. `whoami`, `createHistoryStream`, etc.)
- `keys.zig` a small helper library to load up local keys from `~/.ssb/secret`
## license
GPLv3