From 4269c5f7b2a20c57c747ee5982ca671b051eabd4 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sun, 9 Jan 2022 22:32:42 +0400 Subject: [PATCH] stop using go-libp2p-discovery --- config/config.go | 4 ++-- go.mod | 1 - go.sum | 2 -- p2p/host/autorelay/autorelay_test.go | 3 +-- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/config/config.go b/config/config.go index 6e9ce805b8..b3f80fa28b 100644 --- a/config/config.go +++ b/config/config.go @@ -18,6 +18,7 @@ import ( "github.com/libp2p/go-libp2p-core/transport" "github.com/libp2p/go-libp2p-peerstore/pstoremem" + drouting "github.com/libp2p/go-libp2p/p2p/discovery/routing" "github.com/libp2p/go-libp2p/p2p/host/autonat" "github.com/libp2p/go-libp2p/p2p/host/autorelay" bhost "github.com/libp2p/go-libp2p/p2p/host/basic" @@ -27,7 +28,6 @@ import ( "github.com/libp2p/go-libp2p/p2p/protocol/holepunch" blankhost "github.com/libp2p/go-libp2p-blankhost" - discovery "github.com/libp2p/go-libp2p-discovery" swarm "github.com/libp2p/go-libp2p-swarm" tptu "github.com/libp2p/go-libp2p-transport-upgrader" @@ -285,7 +285,7 @@ func (cfg *Config) NewNode() (host.Host, error) { h.Close() return nil, fmt.Errorf("cannot enable autorelay; no suitable routing for discovery") } - opts = append(opts, autorelay.WithDiscoverer(discovery.NewRoutingDiscovery(crouter))) + opts = append(opts, autorelay.WithDiscoverer(drouting.NewRoutingDiscovery(crouter))) } ar, err = autorelay.NewAutoRelay(h, router, opts...) if err != nil { diff --git a/go.mod b/go.mod index 65ba88448b..83352d0bfd 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,6 @@ require ( github.com/libp2p/go-libp2p-blankhost v0.3.0 github.com/libp2p/go-libp2p-circuit v0.4.1-0.20220104091935-28fb8d25f785 github.com/libp2p/go-libp2p-core v0.13.1-0.20220104083644-a3dd401efe36 - github.com/libp2p/go-libp2p-discovery v0.6.0 github.com/libp2p/go-libp2p-mplex v0.4.1 github.com/libp2p/go-libp2p-nat v0.1.0 github.com/libp2p/go-libp2p-netutil v0.1.0 diff --git a/go.sum b/go.sum index 187d1caf86..02dae809e3 100644 --- a/go.sum +++ b/go.sum @@ -411,8 +411,6 @@ github.com/libp2p/go-libp2p-core v0.11.0/go.mod h1:ECdxehoYosLYHgDDFa2N4yE8Y7aQR github.com/libp2p/go-libp2p-core v0.12.0/go.mod h1:ECdxehoYosLYHgDDFa2N4yE8Y7aQRAMf0sX9mf2sbGg= github.com/libp2p/go-libp2p-core v0.13.1-0.20220104083644-a3dd401efe36 h1:b/pMmgc5EV+dqSc+MjkX5xPa1nV6EKiOb0L0XT03Lic= github.com/libp2p/go-libp2p-core v0.13.1-0.20220104083644-a3dd401efe36/go.mod h1:KlkHsZ0nKerWsXLZJm3LfFQwusI5k3iN4BgtYTE4IYE= -github.com/libp2p/go-libp2p-discovery v0.6.0 h1:1XdPmhMJr8Tmj/yUfkJMIi8mgwWrLUsCB3bMxdT+DSo= -github.com/libp2p/go-libp2p-discovery v0.6.0/go.mod h1:/u1voHt0tKIe5oIA1RHBKQLVCWPna2dXmPNHc2zR9S8= github.com/libp2p/go-libp2p-mplex v0.4.1 h1:/pyhkP1nLwjG3OM+VuaNJkQT/Pqq73WzB3aDN3Fx1sc= github.com/libp2p/go-libp2p-mplex v0.4.1/go.mod h1:cmy+3GfqfM1PceHTLL7zQzAAYaryDu6iPSC+CIb094g= github.com/libp2p/go-libp2p-nat v0.1.0 h1:vigUi2MEN+fwghe5ijpScxtbbDz+L/6y8XwlzYOJgSY= diff --git a/p2p/host/autorelay/autorelay_test.go b/p2p/host/autorelay/autorelay_test.go index fe62c1d519..41ec3fdb14 100644 --- a/p2p/host/autorelay/autorelay_test.go +++ b/p2p/host/autorelay/autorelay_test.go @@ -9,6 +9,7 @@ import ( "time" "github.com/libp2p/go-libp2p" + discovery "github.com/libp2p/go-libp2p/p2p/discovery/routing" "github.com/libp2p/go-libp2p/p2p/host/autorelay" relayv1 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv1/relay" relayv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/relay" @@ -19,8 +20,6 @@ import ( "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/routing" - discovery "github.com/libp2p/go-libp2p-discovery" - "github.com/ipfs/go-cid" ma "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net"