code: func (s *Swarm) Stop() error {
  	if s.tracerClose != nil {
  		err := s.tracerClose.Close()
  		tracing.FinishSpans()
  		if err != nil {
  			return err
  		}
  	}
  
  	if s.ps != nil {
  		s.ps.Stop()
  	}
  	if ch := s.config.Swap.Chequebook(); ch != nil {
  		ch.Stop()
  		ch.Save()
  	}
  	if s.swap != nil {
  		s.swap.Close()
  	}
  	if s.accountingMetrics != nil {
  		s.accountingMetrics.Close()
  	}
  	if s.netStore != nil {
  		s.netStore.Close()
  	}
  	s.sfs.Stop()
  	stopCounter.Inc(1)
  	s.streamer.Stop()
  
  	err := s.bzz.Stop()
  	if s.stateStore != nil {
  		s.stateStore.Close()
  	}
  
  	for _, cleanF := range s.cleanupFuncs {
  		err = cleanF()
  		if err != nil {
  			log.Error("encountered an error while running cleanup function", "err", err)
  			break
  		}
  	}
  	return err
  }
docs: // implements the node.Service interface
  // stops all component services.