feat(swarm): Implement decentralized node discovery and content federation system
- Add swarm node registry with discovery, gossip, and timeline synchronization - Implement database schema for swarm nodes, seeds, and sync logs with proper indexing - Create swarm API endpoints for node discovery, gossip protocol, timeline sharing, and announcements - Add content moderation features with NSFW flagging and muted nodes support - Implement user settings pages for content filtering and node moderation - Add background scheduler for automated swarm synchronization and node health checks - Create .well-known endpoint for swarm protocol discovery - Remove legacy bot-cron.ts in favor of integrated scheduler system - Add user account NSFW preferences and age verification tracking - Update database schema with swarm-related tables and user moderation fields - Enhance post and user components to support federated content display - Add instrumentation for monitoring swarm operations and node health
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Next.js Instrumentation
|
||||
*
|
||||
* This file runs when the Next.js server starts.
|
||||
* We use it to initialize background tasks like:
|
||||
* - Swarm announcement (on startup)
|
||||
* - Bot cron (every 1 minute)
|
||||
* - Swarm gossip (every 5 minutes)
|
||||
*
|
||||
* This eliminates the need for a separate cron process.
|
||||
*/
|
||||
|
||||
export async function register() {
|
||||
// Only run on the server (not during build or in edge runtime)
|
||||
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
||||
const { startBackgroundTasks } = await import('@/lib/background/scheduler');
|
||||
startBackgroundTasks();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user