grpc: directory replication API for websites to mirror accounts/channels

Snapshot (full read) + Subscribe (live stream) over the same committed-entry
channel gossip uses. Identity and metadata only — password hashes, SCRAM
verifiers, cert fingerprints, and the finer channel-ops-list events never
cross this API. Bearer-token authenticated, optional server TLS. Verified
end-to-end against a live test-net registration, not just unit tests.
This commit is contained in:
Jean Chevronnet 2026-07-12 23:10:21 +00:00
parent bdcce01f11
commit e5a0d2acdf
No known key found for this signature in database
11 changed files with 1188 additions and 8 deletions

View file

@ -122,6 +122,11 @@ impl Engine {
self.db.missing_for(peer)
}
// A full read of current directory state, for the gRPC Snapshot RPC.
pub fn directory_snapshot(&self) -> (Vec<db::Account>, Vec<db::ChannelInfo>) {
(self.db.accounts().cloned().collect(), self.db.channels().cloned().collect())
}
pub fn gossip_ingest(&mut self, entry: LogEntry) -> std::io::Result<()> {
// If ingesting a peer's entry removed an account a local session relied on
// (lost a conflict, or dropped elsewhere), clean up after it.