Expand description
Wire protocol for room discovery and message broadcast.
Two gossipsub topics:
ROOMS_TOPIC— global, every node subscribes. Used for room advertisements (so all peers see “rooms in this network”).format!("{ROOM_TOPIC_PREFIX}{room_id}")— per-room. Only members of a room subscribe. All room messages flow here.
Structs§
- Room
Announcement - Broadcast on the global ROOMS_TOPIC. Each peer republishes the rooms they’re currently in, periodically. Listeners maintain a cache with TTL.
- Signed
Room Message - Application-level signed envelope around a
RoomMessage. Used for any message whose authenticity matters beyond gossipsub’s transport- level signing.
Enums§
- Room
Message - All messages on a room’s per-room topic.
- Wire
Message - What actually gets serialized onto a per-room gossipsub topic. New
in v0.3.0 — previously, the raw
RoomMessageJSON went on the wire. All outgoing messages now flow through this envelope so the receiver can tell signed from unsigned at the outer layer without trial- parsing. Tagged so future variants don’t silently misparse.
Constants§
Functions§
- encode_
wire - Serialize an unsigned
RoomMessageto its on-wire bytes inside the newWireMessage::Plainenvelope. The single helper keeps every send site inapp/mod.rsfrom open-coding the wrap. - encode_
wire_ signed - Serialize a
SignedRoomMessageenvelope to its on-wire bytes. - room_
topic