code: func NewDiscoveryService(self NetworkMember, comm CommService, crypt CryptoService, disPol DisclosurePolicy,
  	config DiscoveryConfig) Discovery {
  	d := &gossipDiscoveryImpl{
  		self:             self,
  		incTime:          uint64(time.Now().UnixNano()),
  		seqNum:           uint64(0),
  		deadLastTS:       make(map[string]*timestamp),
  		aliveLastTS:      make(map[string]*timestamp),
  		id2Member:        make(map[string]*NetworkMember),
  		aliveMembership:  util.NewMembershipStore(),
  		deadMembership:   util.NewMembershipStore(),
  		crypt:            crypt,
  		comm:             comm,
  		lock:             &sync.RWMutex{},
  		toDieChan:        make(chan struct{}, 1),
  		toDieFlag:        int32(0),
  		logger:           util.GetLogger(util.DiscoveryLogger, self.InternalEndpoint),
  		disclosurePolicy: disPol,
  		pubsub:           util.NewPubSub(),
  
  		aliveTimeInterval:            config.AliveTimeInterval,
  		aliveExpirationTimeout:       config.AliveExpirationTimeout,
  		aliveExpirationCheckInterval: config.AliveExpirationCheckInterval,
  		reconnectInterval:            config.ReconnectInterval,
  	}
  
  	d.validateSelfConfig()
  	d.msgStore = newAliveMsgStore(d)
  
  	go d.periodicalSendAlive()
  	go d.periodicalCheckAlive()
  	go d.handleMessages()
  	go d.periodicalReconnectToDead()
  	go d.handlePresumedDeadPeers()
  
  	return d
  }
docs: // NewDiscoveryService returns a new discovery service with the comm module passed and the crypto service passed