Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/commands: remove 'ipfs dht' commands, except 'query' #10328

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions core/commands/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ func TestCommands(t *testing.T) {
"/dag/resolve",
"/dag/stat",
"/dht",
"/dht/findpeer",
"/dht/findprovs",
"/dht/get",
"/dht/provide",
"/dht/put",
"/dht/query",
"/routing",
"/routing/put",
Expand Down
57 changes: 1 addition & 56 deletions core/commands/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,65 +21,10 @@ var DhtCmd = &cmds.Command{
},

Subcommands: map[string]*cmds.Command{
"query": queryDhtCmd,
"findprovs": findProvidersDhtCmd,
"findpeer": findPeerDhtCmd,
"get": getValueDhtCmd,
"put": putValueDhtCmd,
"provide": provideRefDhtCmd,
"query": queryDhtCmd,
},
}

var findProvidersDhtCmd = &cmds.Command{
Helptext: findProvidersRoutingCmd.Helptext,
Arguments: findProvidersRoutingCmd.Arguments,
Options: findProvidersRoutingCmd.Options,
Run: findProvidersRoutingCmd.Run,
Encoders: findProvidersRoutingCmd.Encoders,
Type: findProvidersRoutingCmd.Type,
Status: cmds.Deprecated,
}

var findPeerDhtCmd = &cmds.Command{
Helptext: findPeerRoutingCmd.Helptext,
Arguments: findPeerRoutingCmd.Arguments,
Options: findPeerRoutingCmd.Options,
Run: findPeerRoutingCmd.Run,
Encoders: findPeerRoutingCmd.Encoders,
Type: findPeerRoutingCmd.Type,
Status: cmds.Deprecated,
}

var getValueDhtCmd = &cmds.Command{
Helptext: getValueRoutingCmd.Helptext,
Arguments: getValueRoutingCmd.Arguments,
Options: getValueRoutingCmd.Options,
Run: getValueRoutingCmd.Run,
Encoders: getValueRoutingCmd.Encoders,
Type: getValueRoutingCmd.Type,
Status: cmds.Deprecated,
}

var putValueDhtCmd = &cmds.Command{
Helptext: putValueRoutingCmd.Helptext,
Arguments: putValueRoutingCmd.Arguments,
Options: putValueRoutingCmd.Options,
Run: putValueRoutingCmd.Run,
Encoders: putValueRoutingCmd.Encoders,
Type: putValueRoutingCmd.Type,
Status: cmds.Deprecated,
}

var provideRefDhtCmd = &cmds.Command{
Helptext: provideRefRoutingCmd.Helptext,
Arguments: provideRefRoutingCmd.Arguments,
Options: provideRefRoutingCmd.Options,
Run: provideRefRoutingCmd.Run,
Encoders: provideRefRoutingCmd.Encoders,
Type: provideRefRoutingCmd.Type,
Status: cmds.Deprecated,
}

// kademlia extends the routing interface with a command to get the peers closest to the target
type kademlia interface {
routing.Routing
Expand Down
7 changes: 6 additions & 1 deletion docs/changelogs/v0.27.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [Gateway: support for `/api/v0` is deprecated](#gateway-support-for-apiv0-is-deprecated)
- [IPNS resolver cache's TTL can now be configured](#ipns-resolver-caches-ttl-can-now-be-configured)
- [RPC client: deprecated DHT API, added Routing API](#rpc-client-deprecated-dht-api-added-routing-api)
- [Deprecated DHT commands removed from `/api/v0/dht`](#deprecated-dht-commands-removed-from-apiv0dht)
- [📝 Changelog](#-changelog)
- [👨‍👩‍👧‍👦 Contributors](#-contributors)

Expand All @@ -28,10 +29,14 @@ You can now configure the upper-bound of a cached IPNS entry's Time-To-Live via

#### RPC client: deprecated DHT API, added Routing API

The RPC client now includes a Routing API to match the available commands in `/api/v0/routing`. In addition, the DHT API has been marked as deprecated.
The RPC client for GO (`kubo/client/rpc`) now includes a Routing API to match the available commands in `/api/v0/routing`. In addition, the DHT API has been marked as deprecated.

In the next version, all DHT deprecated methods will be removed from the Go RPC client.

#### Deprecated DHT commands removed from `/api/v0/dht`

All the DHT commands that were deprecated for over a year were finally removed from `/api/v0/dht`. Users should switch to modern `/api/v0/routing` which works with [both Amino DHT and Delegated Routers](https://github.com/ipfs/kubo/blob/master/docs/config.md#routing).

### 📝 Changelog

### 👨‍👩‍👧‍👦 Contributors
2 changes: 1 addition & 1 deletion docs/file-transfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ In the case where node B simply cannot form a connection to node A, despite
knowing that it needs to, the likely culprit is a bad NAT. When node B learns
that it needs to connect to node A, it checks the DHT for addresses for node A,
and then starts trying to connect to them. We can check those addresses by
running `ipfs dht findpeer <node A peerID>` on node B. This command should
running `ipfs routing findpeer <node A peerID>` on node B. This command should
return a list of addresses for node A. If it doesn't return any addresses, then
you should try running the manual providing command from the previous steps.
Example output of addresses might look something like this:
Expand Down
2 changes: 0 additions & 2 deletions test/cli/basic_commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ func TestCommandDocsWidth(t *testing.T) {
"ipfs pin remote rm": true,
"ipfs pin remote ls": true,
"ipfs pin verify": true,
"ipfs dht get": true,
"ipfs pin remote service add": true,
"ipfs pin update": true,
"ipfs pin rm": true,
Expand All @@ -167,7 +166,6 @@ func TestCommandDocsWidth(t *testing.T) {
"ipfs name": true,
"ipfs object patch append-data": true,
"ipfs object patch set-data": true,
"ipfs dht put": true,
"ipfs diag profile": true,
"ipfs diag cmds": true,
"ipfs swarm addrs local": true,
Expand Down
137 changes: 0 additions & 137 deletions test/cli/dht_legacy_test.go

This file was deleted.

Loading