Skip to content

Commit 7c05658

Browse files
committed
fix(rpc): restore and reprecate bitswap reprovide
#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
1 parent 580ce69 commit 7c05658

File tree

3 files changed

+22
-17
lines changed

3 files changed

+22
-17
lines changed

β€Žcore/commands/bitswap.go

+15-3
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,28 @@ var BitswapCmd = &cmds.Command{
2121
},
2222

2323
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,
2728
},
2829
}
2930

3031
const (
3132
peerOptionName = "peer"
3233
)
3334

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+
3446
var showWantlistCmd = &cmds.Command{
3547
Helptext: cmds.HelpText{
3648
Tagline: "Show blocks currently on the wantlist.",

β€Žcore/commands/commands_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ func TestCommands(t *testing.T) {
2020
"/add",
2121
"/bitswap",
2222
"/bitswap/ledger",
23+
"/bitswap/reprovide",
2324
"/bitswap/stat",
2425
"/bitswap/wantlist",
2526
"/block",

β€Ždocs/changelogs/v0.34.md

+6-14
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,20 @@
66

77
- [Overview](#overview)
88
- [πŸ”¦ 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)
1310
- [Bitswap improvements from Boxo](#bitswap-improvements-from-boxo)
11+
- [πŸ“ Changelog](#-changelog)
1412
- [πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ Contributors](#-contributors)
1513

1614
### Overview
1715

1816
### πŸ”¦ Highlights
1917

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
2919

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))
3123

3224
#### Bitswap improvements from Boxo
3325

0 commit comments

Comments
Β (0)