diff --git a/client/rpc/api.go b/client/rpc/api.go index 827b427c9..79d42124a 100644 --- a/client/rpc/api.go +++ b/client/rpc/api.go @@ -227,12 +227,6 @@ func (api *HttpApi) Object() iface.ObjectAPI { return (*ObjectAPI)(api) } -// nolint deprecated -// Deprecated: use [HttpApi.Routing] instead. -func (api *HttpApi) Dht() iface.DhtAPI { - return (*DhtAPI)(api) -} - func (api *HttpApi) Swarm() iface.SwarmAPI { return (*SwarmAPI)(api) } diff --git a/client/rpc/dht.go b/client/rpc/dht.go deleted file mode 100644 index cfc886a49..000000000 --- a/client/rpc/dht.go +++ /dev/null @@ -1,33 +0,0 @@ -package rpc - -import ( - "context" - - "github.com/ipfs/boxo/path" - caopts "github.com/ipfs/kubo/core/coreiface/options" - "github.com/libp2p/go-libp2p/core/peer" -) - -type DhtAPI HttpApi - -// nolint deprecated -// Deprecated: use [RoutingAPI.FindPeer] instead. -func (api *DhtAPI) FindPeer(ctx context.Context, p peer.ID) (peer.AddrInfo, error) { - return api.core().Routing().FindPeer(ctx, p) -} - -// nolint deprecated -// Deprecated: use [RoutingAPI.FindProviders] instead. -func (api *DhtAPI) FindProviders(ctx context.Context, p path.Path, opts ...caopts.DhtFindProvidersOption) (<-chan peer.AddrInfo, error) { - return api.core().Routing().FindProviders(ctx, p, opts...) -} - -// nolint deprecated -// Deprecated: use [RoutingAPI.Provide] instead. -func (api *DhtAPI) Provide(ctx context.Context, p path.Path, opts ...caopts.DhtProvideOption) error { - return api.core().Routing().Provide(ctx, p, opts...) -} - -func (api *DhtAPI) core() *HttpApi { - return (*HttpApi)(api) -} diff --git a/core/coreapi/coreapi.go b/core/coreapi/coreapi.go index 6c6aa4907..b757929a2 100644 --- a/core/coreapi/coreapi.go +++ b/core/coreapi/coreapi.go @@ -130,12 +130,6 @@ func (api *CoreAPI) Pin() coreiface.PinAPI { return (*PinAPI)(api) } -// nolint deprecated -// Deprecated: use [CoreAPI.Routing] instead. -func (api *CoreAPI) Dht() coreiface.DhtAPI { - return (*DhtAPI)(api) -} - // Swarm returns the SwarmAPI interface implementation backed by the go-ipfs node func (api *CoreAPI) Swarm() coreiface.SwarmAPI { return (*SwarmAPI)(api) diff --git a/core/coreapi/dht.go b/core/coreapi/dht.go deleted file mode 100644 index f9155de00..000000000 --- a/core/coreapi/dht.go +++ /dev/null @@ -1,34 +0,0 @@ -package coreapi - -import ( - "context" - - "github.com/ipfs/boxo/path" - coreiface "github.com/ipfs/kubo/core/coreiface" - caopts "github.com/ipfs/kubo/core/coreiface/options" - peer "github.com/libp2p/go-libp2p/core/peer" -) - -type DhtAPI CoreAPI - -// nolint deprecated -// Deprecated: use [RoutingAPI.FindPeer] instead. -func (api *DhtAPI) FindPeer(ctx context.Context, p peer.ID) (peer.AddrInfo, error) { - return api.core().Routing().FindPeer(ctx, p) -} - -// nolint deprecated -// Deprecated: use [RoutingAPI.FindProviders] instead. -func (api *DhtAPI) FindProviders(ctx context.Context, p path.Path, opts ...caopts.DhtFindProvidersOption) (<-chan peer.AddrInfo, error) { - return api.core().Routing().FindProviders(ctx, p, opts...) -} - -// nolint deprecated -// Deprecated: use [RoutingAPI.Provide] instead. -func (api *DhtAPI) Provide(ctx context.Context, p path.Path, opts ...caopts.DhtProvideOption) error { - return api.core().Routing().Provide(ctx, p, opts...) -} - -func (api *DhtAPI) core() coreiface.CoreAPI { - return (*CoreAPI)(api) -} diff --git a/core/coreiface/coreapi.go b/core/coreiface/coreapi.go index bcd94f381..dbb08dd7e 100644 --- a/core/coreiface/coreapi.go +++ b/core/coreiface/coreapi.go @@ -34,10 +34,6 @@ type CoreAPI interface { // Object returns an implementation of Object API Object() ObjectAPI - // nolint deprecated - // Deprecated: use [Routing] instead. - Dht() DhtAPI - // Swarm returns an implementation of Swarm API Swarm() SwarmAPI diff --git a/core/coreiface/dht.go b/core/coreiface/dht.go deleted file mode 100644 index 001f5856a..000000000 --- a/core/coreiface/dht.go +++ /dev/null @@ -1,25 +0,0 @@ -package iface - -import ( - "context" - - "github.com/ipfs/boxo/path" - "github.com/ipfs/kubo/core/coreiface/options" - "github.com/libp2p/go-libp2p/core/peer" -) - -// nolint deprecated -// Deprecated: use [RoutingAPI] instead. -type DhtAPI interface { - // nolint deprecated - // Deprecated: use [RoutingAPI.FindPeer] instead. - FindPeer(context.Context, peer.ID) (peer.AddrInfo, error) - - // nolint deprecated - // Deprecated: use [RoutingAPI.FindProviders] instead. - FindProviders(context.Context, path.Path, ...options.DhtFindProvidersOption) (<-chan peer.AddrInfo, error) - - // nolint deprecated - // Deprecated: use [RoutingAPI.Provide] instead. - Provide(context.Context, path.Path, ...options.DhtProvideOption) error -} diff --git a/docs/changelogs/v0.28.md b/docs/changelogs/v0.28.md index a811e81aa..2bb61707a 100644 --- a/docs/changelogs/v0.28.md +++ b/docs/changelogs/v0.28.md @@ -6,6 +6,7 @@ - [Overview](#overview) - [๐Ÿ”ฆ Highlights](#-highlights) + - [RPC client: removed deprecated DHT API](#rpc-client-removed-deprecated-dht-api) - [๐Ÿ“ Changelog](#-changelog) - [๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Contributors](#-contributors) @@ -13,6 +14,10 @@ ### ๐Ÿ”ฆ Highlights +#### RPC client: removed deprecated DHT API + +The deprecated DHT API commands in the RPC client have been removed. Instead, use the Routing API. + ### ๐Ÿ“ Changelog ### ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Contributors