@cryptotaxi247 / kubo / commits / e77a484aa

fix(rpc): restore and reprecate `bitswap reprovide` (#10699)

https://github.com/ipfs/kubo/pull/10677 removed command without properly deprecating it first, this restores it and marks as deprecated we can remove it after at least 1 release with deprecation being announced

Marcin Rataj committed Feb 10, 2025 at 16:12 UTC e77a484aa83544725e58ab7ae0eea0e63c3bedb8
3 files changed +22 -17
core/commands/bitswap.go
+15 -3
@@ -21,9 +21,10 @@ var BitswapCmd = &cmds.Command{
21 },
22
23 Subcommands: map[string]*cmds.Command{
24 - "stat": bitswapStatCmd,
25 - "wantlist": showWantlistCmd,
26 - "ledger": ledgerCmd,
24 + "stat": bitswapStatCmd,
25 + "wantlist": showWantlistCmd,
26 + "ledger": ledgerCmd,
27 + "reprovide": deprecatedBitswapReprovideCmd,
28 },
29 }
30
@@ -31,6 +32,17 @@ const (
32 peerOptionName = "peer"
33 )
34
35 +var deprecatedBitswapReprovideCmd = &cmds.Command{
36 + Status: cmds.Deprecated,
37 + Helptext: cmds.HelpText{
38 + Tagline: "Deprecated command to announce to bitswap. Use 'ipfs routing reprovide' instead.",
39 + ShortDescription: `
40 +'ipfs bitswap reprovide' is a legacy plumbing command used to announce to DHT.
41 +Deprecated, use modern 'ipfs routing reprovide' instead.`,
42 + },
43 + Run: reprovideRoutingCmd.Run, // alias to routing reprovide to not break existing users
44 +}
45 +
46 var showWantlistCmd = &cmds.Command{
47 Helptext: cmds.HelpText{
48 Tagline: "Show blocks currently on the wantlist.",
core/commands/commands_test.go
+1
@@ -20,6 +20,7 @@ func TestCommands(t *testing.T) {
20 "/add",
21 "/bitswap",
22 "/bitswap/ledger",
23 + "/bitswap/reprovide",
24 "/bitswap/stat",
25 "/bitswap/wantlist",
26 "/block",
docs/changelogs/v0.34.md
+6 -14
@@ -6,28 +6,20 @@
6
7 - [Overview](#overview)
8 - [🔦 Highlights](#-highlights)
9 - - [JSON config validation](#json-config-validation)
10 - - [Reprovide command moved to routing](#reprovide-command-moved-to-routing)
11 - - [Additional stats for Accelerated DHT Reprovides](#additional-stats-for-accelerated-dht-reprovides)
12 -- [📝 Changelog](#-changelog)
9 + - [RPC and CLI command changes](#rpc-and-cli-command-changes)
10 - [Bitswap improvements from Boxo](#bitswap-improvements-from-boxo)
11 +- [📝 Changelog](#-changelog)
12 - [👨‍👩‍👧‍👦 Contributors](#-contributors)
13
14 ### Overview
15
16 ### 🔦 Highlights
17
20 -#### JSON config validation
21 -
22 -`ipfs config` is now validating json fields ([#10679](https://github.com/ipfs/kubo/pull/10679)).
23 -
24 -#### Reprovide command moved to routing
25 -
26 -Moved the `bitswap reprovide` command to `routing reprovide`. ([#10677](https://github.com/ipfs/kubo/pull/10677))
27 -
28 -#### Additional stats for Accelerated DHT Reprovides
18 +#### RPC and CLI command changes
19
30 -The `stats reprovide` command now shows additional stats for the DHT Accelerated Client, indicating the last and next `reprovide` times. ([#10677](https://github.com/ipfs/kubo/pull/10677))
20 +- `ipfs config` is now validating json fields ([#10679](https://github.com/ipfs/kubo/pull/10679)).
21 +- Deprecated the `bitswap reprovide` command. Make sure to switch to modern `routing reprovide`. ([#10677](https://github.com/ipfs/kubo/pull/10677))
22 +- The `stats reprovide` command now shows additional stats for [`Routing.AcceleratedDHTClient`](https://github.com/ipfs/kubo/blob/master/docs/config.md#routingaccelerateddhtclient), indicating the last and next `reprovide` times. ([#10677](https://github.com/ipfs/kubo/pull/10677))
23
24 #### Bitswap improvements from Boxo
25