Skip to content

Commit

Permalink
core/commands: remove 'ipfs dht' commands, except 'query'
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Jan 31, 2024
1 parent 4d3cc96 commit 5d3411d
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 202 deletions.
5 changes: 0 additions & 5 deletions core/commands/commands_test.go
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
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
4 changes: 2 additions & 2 deletions docs/file-transfer.md
Expand Up @@ -68,7 +68,7 @@ pitfalls that people run into)
### Checking providers
When requesting content on ipfs, nodes search the DHT for 'provider records' to
see who has what content. Let's manually do that on node B to make sure that
node B is able to determine that node A has the data. Run `ipfs dht findprovs
node B is able to determine that node A has the data. Run `ipfs routing findprovs
<hash>`. We expect to see the peer ID of node A printed out. If this command
returns nothing (or returns IDs that are not node A), then no record of A
having the data exists on the network. This can happen if the data is added
Expand All @@ -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
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.

0 comments on commit 5d3411d

Please sign in to comment.