# libantpeer C++17 peer library for [Antheos](https://langsyn.org/libantheos/latest/) bus communication. Transport abstraction, service endpoints, service consumers, and Ed25519 authentication. **Author:** Are Bjørby Built on [libantheos](https://langsyn.org/libantheos/latest/), [libmembus](https://langsyn.org/libmembus/latest/), [libsockbus](https://langsyn.org/libsockbus/latest/) and libblebus. ## Build ```bash make # Build libantpeer.a + libantpeer.so make test # Build and run both suites make install # Install to /usr/local (sudo required) make clean # Remove build artifacts ``` Requires: `g++` with C++17, Linux, OpenSSL 3.0, [libantheos](https://langsyn.org/libantheos/latest/), [libmembus](https://langsyn.org/libmembus/latest/), [libsockbus](https://langsyn.org/libsockbus/latest/) and libblebus. libblebus is named without a link on purpose: unlike its three siblings it has no published repository yet, and a link on a published page should not point at nothing. It is a build requirement all the same — the Makefile links `-lblebus` and `antpeer.hpp` declares `blebus_open`. ## API Two public headers: `#include ` and `#include `. The `antpeer/` prefix is required as of **v4.0.0 (2026-08-25)**; before that both installed flat into `/usr/local/include/`. `Ed25519Utils.hpp` is not a name this library can claim on its own — a second header of that name exists one directory over in the same ecology, declaring a different `KeyPair` in a different namespace. A clean break with no compatibility path at the old location: the flat headers had no consumers to break. ```cpp // Transport auto bus = antpeer::membus_open("my_bus"); // Shared memory auto bus = antpeer::sockbus_open("host:9000"); // TCP socket // Server (service endpoint) antpeer::Server srv(std::move(bus), "OID", "DID", "SVC"); srv.on_request([](auto& ctx) { ctx.reply("response"); }); srv.on_session([](auto& ctx) { /* session messages */ }); srv.require_auth("/path/to/trusted_keys"); // Ed25519 auth srv.run(); // Poll loop // Client (service consumer) antpeer::Client cli(std::move(bus), "OID", "DID"); cli.discover("TARGET_SVC"); // Find service auto n = cli.call("verb payload", buf, sizeof(buf), 5000); // RPC cli.set_auth_key("/path/to/private.key"); // Ed25519 auth ``` ## Features - **Transport abstraction**: Shared memory (membus), TCP (sockbus) and Bluetooth LE (blebus), via the `Bus` base class. - **Server**: Request/session/notify handlers, threaded dispatch, session expiry. - **Client**: Discover/call/fire operations, auto-reconnect with session recovery. - **Ed25519 auth**: Direct and multi-hop relay authentication (Z-verb, Level 2). - **FrameExtractor**: Protocol-correct Antheos frame extraction from byte streams. - **Pimpl**: Stable ABI, no implementation details in public headers. See the [Antheos Protocol Spec](https://langsyn.org/libantheos/latest/docs/ANTHEOS_PROTOCOL_SPEC.md) for the wire protocol. ## Contributing See [CONTRIBUTING.md](CONTRIBUTING.md) for coding standards and how to contribute. ## License MIT License — see [LICENSE](LICENSE).