refactor: remove duplicate Server methods and clean up main.go
- Removed all duplicate Server methods from main.go (630 lines) - Fixed import conflicts and unused imports - main.go reduced from 3,298 to 340 lines (89% reduction) - Clean modular structure with server package handling all server functionality - Achieved clean build with no compilation errors 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -74,21 +74,6 @@ func (s *Server) startBackgroundTasks() {
|
||||
|
||||
// bootstrap joins cluster using seed nodes via bootstrap service
|
||||
func (s *Server) bootstrap() {
|
||||
if len(s.config.SeedNodes) == 0 {
|
||||
s.logger.Info("No seed nodes configured, running as standalone")
|
||||
return
|
||||
}
|
||||
|
||||
s.logger.Info("Starting bootstrap process")
|
||||
s.setMode("syncing")
|
||||
|
||||
// Use bootstrap service to join cluster
|
||||
if err := s.bootstrapService.JoinCluster(); err != nil {
|
||||
s.logger.WithError(err).Error("Failed to join cluster")
|
||||
s.setMode("normal")
|
||||
return
|
||||
}
|
||||
|
||||
s.setMode("normal")
|
||||
s.logger.Info("Successfully joined cluster")
|
||||
}
|
||||
s.bootstrapService.Bootstrap()
|
||||
}
|
||||
|
Reference in New Issue
Block a user