The Swarm
The Swarm is Synapsis’s native node-to-node communication layer. It enables fast, real-time data exchange between Synapsis nodes.
What is the Swarm?
The Swarm is a mesh network of Synapsis nodes that communicate directly via simple JSON APIs. It handles:
- Node Discovery — Automatic discovery of other Synapsis nodes
- User Profiles — View any user’s full profile across nodes
- Timeline Aggregation — Build swarm-wide feeds from multiple nodes
- Handle Resolution — Find which node hosts a given user
- Social Interactions — Likes, reposts, follows, and mentions delivered directly
- Real DMs — Private messaging between users on any node as you’re used to
Why the Swarm?
The Swarm was designed specifically for Synapsis, providing:
| Feature | Benefit |
|---|---|
| Speed | Single request, instant response |
| Real-time Data | Always fresh, complete information |
| Clean Format | Simple JSON APIs |
| Instant Delivery | Interactions delivered immediately |
| Real DMs | An actual dm inbox, no compromises |
| Auto Discovery | Nodes find each other automatically |
Key Features
Real DMs
An actual direct message inbox just like you’re used to, with no compromises and no “private mentions”.
- Real-time message delivery
- Read receipts and delivery status
- Proper chat UI with conversations
Cross-Node User Profiles
Click on any user from another Synapsis node and see their full profile — avatar, header, bio, accurate follower counts, and all their posts. It works just like viewing a local user.
Swarm Timeline
The Explore page aggregates posts from across the swarm, giving you a network-wide view of activity.
Instant Interactions
Like, repost, follow, or mention users on other Synapsis nodes with instant delivery. Interactions are delivered directly via the swarm protocol.
Automatic Discovery
Nodes automatically discover each other through gossip. No manual configuration needed — just join the swarm and start connecting.
How It Works
The Swarm uses a hybrid approach combining the best of centralized and decentralized systems:
- Seed Nodes provide initial bootstrap points
- Gossip Protocol spreads node information through the network
- Direct APIs enable real-time data exchange between nodes
This means:
- New nodes can easily join by contacting a seed
- The network remains functional even if seeds go down
- Cross-node features work instantly without complex federation
Quick Start
For Node Operators
Your node automatically participates in the Swarm. On startup, it will:
- Announce itself to configured seed nodes
- Begin periodic gossip rounds with known peers
- Build a local registry of discovered nodes
Manual Operations (Admin)
Admins can trigger swarm operations via the API:
# Announce to all seeds
curl -X POST https://your-node.com/api/swarm/nodes \
-H "Content-Type: application/json" \
-d '{"action": "announce"}'
# Run a gossip round
curl -X POST https://your-node.com/api/swarm/nodes \
-H "Content-Type: application/json" \
-d '{"action": "gossip"}'
# Discover a specific node
curl -X POST https://your-node.com/api/swarm/nodes \
-H "Content-Type: application/json" \
-d '{"action": "discover", "domain": "other-node.com"}'Endpoints
| Endpoint | Description |
|---|---|
GET /api/swarm/users/[handle] | Get a user’s profile and posts |
GET /api/swarm/posts/[id] | Get a single post |
GET /api/swarm/timeline | Get recent posts from this node |
GET /api/swarm/info | This node’s swarm info |
GET /api/swarm/nodes | List known nodes |
POST /api/swarm/announce | Receive node announcements |
POST /api/swarm/gossip | Exchange gossip with peers |
POST /api/swarm/interactions/like | Receive likes |
POST /api/swarm/interactions/follow | Receive follows |
POST /api/swarm/interactions/repost | Receive reposts |
POST /api/swarm/interactions/mention | Receive mentions |
POST /api/swarm/replies | Receive replies |
GET /.well-known/synapsis-swarm | Public swarm discovery info |