Skip to content

fix(rpc): restore and deprecate bitswap reprovide #10699

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

Merged
merged 1 commit into from
Feb 10, 2025
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
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
Loading