Skip to content

Commit

Permalink
Remove all dynamic peer discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Dec 10, 2024
1 parent 8535262 commit 01805c5
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 376 deletions.
8 changes: 0 additions & 8 deletions p2p/communication.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ type Communication struct {
externalAddr maddr.Multiaddr
streamMgr *StreamMgr
whitelistedPeers []peer.ID
discovery *PeerDiscovery
}

// NewCommunication create a new instance of Communication
Expand Down Expand Up @@ -248,7 +247,6 @@ func (c *Communication) bootStrapConnectivityCheck() error {
}

func (c *Communication) startChannel(privKeyBytes []byte) error {
c.logger.Info().Msgf("No DHT enabled; use private gossip instead.")
p2pPriKey, err := crypto.UnmarshalSecp256k1PrivateKey(privKeyBytes)
if err != nil {
c.logger.Error().Msgf("error is %f", err)
Expand Down Expand Up @@ -350,9 +348,6 @@ func (c *Communication) startChannel(privKeyBytes []byte) error {
}
bootstrapPeerAddrInfos = append(bootstrapPeerAddrInfos, *peerInfo)
}
discovery := NewPeerDiscovery(c.host, bootstrapPeerAddrInfos)
c.discovery = discovery
discovery.Start(context.Background())

return nil
}
Expand Down Expand Up @@ -422,9 +417,6 @@ func (c *Communication) Start(priKeyBytes []byte) error {

// Stop communication
func (c *Communication) Stop() error {
if c.discovery != nil {
c.discovery.Stop()
}
// we need to stop the handler and the p2p services firstly, then terminate the our communication threads
if err := c.host.Close(); err != nil {
c.logger.Err(err).Msg("fail to close host network")
Expand Down
235 changes: 0 additions & 235 deletions p2p/discovery.go

This file was deleted.

93 changes: 0 additions & 93 deletions p2p/discovery_test.go

This file was deleted.

Loading

0 comments on commit 01805c5

Please sign in to comment.