Skip to content

Commit

Permalink
fix(rpc): restore and reprecate bitswap reprovide (#10699)
Browse files Browse the repository at this point in the history
#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
  • Loading branch information
lidel authored Feb 10, 2025
1 parent b387530 commit e77a484
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
18 changes: 15 additions & 3 deletions core/commands/bitswap.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,28 @@ var BitswapCmd = &cmds.Command{
},

Subcommands: map[string]*cmds.Command{
"stat": bitswapStatCmd,
"wantlist": showWantlistCmd,
"ledger": ledgerCmd,
"stat": bitswapStatCmd,
"wantlist": showWantlistCmd,
"ledger": ledgerCmd,
"reprovide": deprecatedBitswapReprovideCmd,
},
}

const (
peerOptionName = "peer"
)

var deprecatedBitswapReprovideCmd = &cmds.Command{
Status: cmds.Deprecated,
Helptext: cmds.HelpText{
Tagline: "Deprecated command to announce to bitswap. Use 'ipfs routing reprovide' instead.",
ShortDescription: `
'ipfs bitswap reprovide' is a legacy plumbing command used to announce to DHT.
Deprecated, use modern 'ipfs routing reprovide' instead.`,
},
Run: reprovideRoutingCmd.Run, // alias to routing reprovide to not break existing users
}

var showWantlistCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "Show blocks currently on the wantlist.",
Expand Down
1 change: 1 addition & 0 deletions core/commands/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func TestCommands(t *testing.T) {
"/add",
"/bitswap",
"/bitswap/ledger",
"/bitswap/reprovide",
"/bitswap/stat",
"/bitswap/wantlist",
"/block",
Expand Down
20 changes: 6 additions & 14 deletions docs/changelogs/v0.34.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,20 @@

- [Overview](#overview)
- [πŸ”¦ Highlights](#-highlights)
- [JSON config validation](#json-config-validation)
- [Reprovide command moved to routing](#reprovide-command-moved-to-routing)
- [Additional stats for Accelerated DHT Reprovides](#additional-stats-for-accelerated-dht-reprovides)
- [πŸ“ Changelog](#-changelog)
- [RPC and CLI command changes](#rpc-and-cli-command-changes)
- [Bitswap improvements from Boxo](#bitswap-improvements-from-boxo)
- [πŸ“ Changelog](#-changelog)
- [πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ Contributors](#-contributors)

### Overview

### πŸ”¦ Highlights

#### JSON config validation

`ipfs config` is now validating json fields ([#10679](https://github.com/ipfs/kubo/pull/10679)).

#### Reprovide command moved to routing

Moved the `bitswap reprovide` command to `routing reprovide`. ([#10677](https://github.com/ipfs/kubo/pull/10677))

#### Additional stats for Accelerated DHT Reprovides
#### RPC and CLI command changes

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))
- `ipfs config` is now validating json fields ([#10679](https://github.com/ipfs/kubo/pull/10679)).
- Deprecated the `bitswap reprovide` command. Make sure to switch to modern `routing reprovide`. ([#10677](https://github.com/ipfs/kubo/pull/10677))
- 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))

#### Bitswap improvements from Boxo

Expand Down

0 comments on commit e77a484

Please sign in to comment.