diff --git a/daemon.go b/daemon.go index 02c1462..ab89aed 100644 --- a/daemon.go +++ b/daemon.go @@ -7,7 +7,6 @@ import ( logging "github.com/ipfs/go-log" libp2p "github.com/libp2p/go-libp2p" - discovery "github.com/libp2p/go-libp2p-discovery" host "github.com/libp2p/go-libp2p-host" dht "github.com/libp2p/go-libp2p-kad-dht" dhtopts "github.com/libp2p/go-libp2p-kad-dht/opts" @@ -15,7 +14,6 @@ import ( proto "github.com/libp2p/go-libp2p-protocol" ps "github.com/libp2p/go-libp2p-pubsub" routing "github.com/libp2p/go-libp2p-routing" - bhost "github.com/libp2p/go-libp2p/p2p/host/basic" relay "github.com/libp2p/go-libp2p/p2p/host/relay" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr-net" @@ -118,16 +116,6 @@ func (d *Daemon) EnablePubsub(router string, sign, strict bool) error { } -func (d *Daemon) EnableAutoRelay() error { - if d.dht == nil { - return fmt.Errorf("DHT must be enabled for autorelay") - } - - disc := discovery.NewRoutingDiscovery(d.dht) - d.autorelay = relay.NewAutoRelayHost(d.ctx, d.host.(*bhost.BasicHost), disc) - return nil -} - func (d *Daemon) ID() peer.ID { return d.host.ID() } diff --git a/p2pd/main.go b/p2pd/main.go index 18af6dc..5c2a393 100644 --- a/p2pd/main.go +++ b/p2pd/main.go @@ -138,16 +138,6 @@ func main() { } } - if *autoRelay { - if !*relayEnabled { - log.Fatal("Relay must be enabled to enable auto relay") - } - err = d.EnableAutoRelay() - if err != nil { - log.Fatal(err) - } - } - if !*quiet { fmt.Printf("Control socket: %s\n", maddr.String()) fmt.Printf("Peer ID: %s\n", d.ID().Pretty())