refactor: Migrate from ActivityPub federation to native Swarm network

- Remove ActivityPub infrastructure (webfinger, nodeinfo, inbox, activities, signatures)
- Implement native peer-to-peer Swarm network with gossip protocol
- Replace federated timeline with Swarm timeline aggregating posts from all nodes
- Migrate direct messaging to end-to-end encrypted Swarm Chat system
- Update user interactions (follow, like, repost) to use Swarm protocol
- Add cryptographic key management for DID-based identity system
- Remove server-bound identity model in favor of portable DID identities
- Update documentation to reflect Swarm architecture and capabilities
- Add debug utilities and chat testing tools for Swarm network
- Refactor database schema to support distributed user directory
- Update bot framework to work with Swarm network interactions
- Simplify API routes to use Swarm protocol instead of ActivityPub
- This transition enables true peer-to-peer communication, instant interactions, and encrypted messaging while maintaining sovereign identity through DIDs
This commit is contained in:
Christomatt
2026-01-27 01:27:15 +01:00
parent 6b8eeb6814
commit eb63194c56
49 changed files with 1173 additions and 3559 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
* 1. Seed nodes (like node.synapsis.social) provide initial bootstrap
* 2. Gossip protocol spreads node/handle information epidemically
* 3. Any node can discover the full network without central authority
* 4. Direct node-to-node interactions (likes, follows, etc.) bypass ActivityPub
* 4. Direct node-to-node interactions (likes, follows, etc.) for instant delivery
*
* Usage:
* - On node startup: call announceToSeeds() to register with the network
+1 -2
View File
@@ -2,8 +2,7 @@
* Swarm Interactions
*
* Handles direct node-to-node interactions in the swarm network.
* This is the "Swarm-first" approach - we try direct swarm communication
* first, and fall back to ActivityPub for non-Synapsis nodes.
* All interactions are delivered directly via the swarm protocol.
*
* Supported interactions:
* - Likes: Direct like delivery between swarm nodes
+3 -5
View File
@@ -190,11 +190,9 @@ export async function fetchSwarmTimeline(
: result.posts.filter(p => !p.isNsfw && !p.nodeIsNsfw);
// Log filtering details for debugging
if (!includeNsfw && result.posts.length > 0) {
const nsfwPosts = result.posts.filter(p => p.isNsfw);
const nodeNsfwPosts = result.posts.filter(p => p.nodeIsNsfw);
console.log(`[Swarm Timeline] ${result.domain}: ${result.posts.length} posts, ${nsfwPosts.length} marked NSFW, ${nodeNsfwPosts.length} from NSFW node, ${filteredPosts.length} after filter`);
}
const nsfwPosts = result.posts.filter(p => p.isNsfw);
const nodeNsfwPosts = result.posts.filter(p => p.nodeIsNsfw);
console.log(`[Swarm Timeline] ${result.domain}: ${result.posts.length} posts fetched, ${nsfwPosts.length} marked NSFW, ${nodeNsfwPosts.length} from NSFW node, ${filteredPosts.length} after filter (includeNsfw: ${includeNsfw})`);
sources.push({
domain: result.domain,