Skip to content

Commit 8550d2e

Browse files
committed
chore: deprecate the pubsub api
Fixes ipfs#9717
1 parent 676e557 commit 8550d2e

File tree

6 files changed

+19
-136
lines changed

6 files changed

+19
-136
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Kubo was the first IPFS implementation and is the most widely used one today. Im
1212
Featureset
1313
- Runs an IPFS-Node as a network service
1414
- [Command Line Interface](https://docs.ipfs.tech/reference/kubo/cli/) to IPFS-Nodes
15-
- Local [Web2-to-Web3 HTTP Gateway functionality](https://github.com/ipfs/specs/tree/main/http-gateways#readme)
15+
- Local [Web2-to-Web3 HTTP Gateway functionality](https://github.com/ipfs/specs/tree/main/http-gateways#readme)
1616
- HTTP RPC API (`/api/v0`) to access and control the daemon
1717
- IPFS's internal Webgui can be used to manage the Kubo nodes
1818

@@ -381,7 +381,6 @@ Some places to get you started on the codebase:
381381
- libp2p
382382
- libp2p: https://github.com/libp2p/go-libp2p
383383
- DHT: https://github.com/libp2p/go-libp2p-kad-dht
384-
- PubSub: https://github.com/libp2p/go-libp2p-pubsub
385384
- [IPFS : The `Add` command demystified](https://github.com/ipfs/kubo/tree/master/docs/add-code-flow.md)
386385

387386
### Map of Implemented Subsystems

cmd/ipfs/daemon.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Headers.
171171
cmds.BoolOption(enableGCKwd, "Enable automatic periodic repo garbage collection"),
172172
cmds.BoolOption(adjustFDLimitKwd, "Check and raise file descriptor limits if needed").WithDefault(true),
173173
cmds.BoolOption(migrateKwd, "If true, assume yes at the migrate prompt. If false, assume no."),
174-
cmds.BoolOption(enablePubSubKwd, "Enable experimental pubsub feature. Overrides Pubsub.Enabled config."),
174+
cmds.BoolOption(enablePubSubKwd, "DEPRECATED"),
175175
cmds.BoolOption(enableIPNSPubSubKwd, "Enable IPNS over pubsub. Implicitly enables pubsub, overrides Ipns.UsePubsub config."),
176176
cmds.BoolOption(enableMultiplexKwd, "DEPRECATED"),
177177
cmds.StringOption(agentVersionSuffix, "Optional suffix to the AgentVersion presented by `ipfs id` and also advertised through BitSwap."),

core/commands/pubsub.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ import (
1616
)
1717

1818
var PubsubCmd = &cmds.Command{
19-
Status: cmds.Experimental,
19+
Status: cmds.Deprecated,
2020
Helptext: cmds.HelpText{
2121
Tagline: "An experimental publish-subscribe system on ipfs.",
2222
ShortDescription: `
2323
ipfs pubsub allows you to publish messages to a given topic, and also to
2424
subscribe to new messages on a given topic.
2525
26-
EXPERIMENTAL FEATURE
26+
DEPRECATED FEATURE (see https://github.com/ipfs/kubo/issues/9717)
2727
2828
It is not intended in its current state to be used in a production
2929
environment. To use, the daemon must be run with
@@ -46,13 +46,13 @@ type pubsubMessage struct {
4646
}
4747

4848
var PubsubSubCmd = &cmds.Command{
49-
Status: cmds.Experimental,
49+
Status: cmds.Deprecated,
5050
Helptext: cmds.HelpText{
5151
Tagline: "Subscribe to messages on a given topic.",
5252
ShortDescription: `
5353
ipfs pubsub sub subscribes to messages on a given topic.
5454
55-
EXPERIMENTAL FEATURE
55+
DEPRECATED FEATURE (see https://github.com/ipfs/kubo/issues/9717)
5656
5757
It is not intended in its current state to be used in a production
5858
environment. To use, the daemon must be run with
@@ -145,14 +145,14 @@ TOPIC AND DATA ENCODING
145145
}
146146

147147
var PubsubPubCmd = &cmds.Command{
148-
Status: cmds.Experimental,
148+
Status: cmds.Deprecated,
149149
Helptext: cmds.HelpText{
150150
Tagline: "Publish data to a given pubsub topic.",
151151
ShortDescription: `
152152
ipfs pubsub pub publishes a message to a specified topic.
153153
It reads binary data from stdin or a file.
154154
155-
EXPERIMENTAL FEATURE
155+
DEPRECATED FEATURE (see https://github.com/ipfs/kubo/issues/9717)
156156
157157
It is not intended in its current state to be used in a production
158158
environment. To use, the daemon must be run with
@@ -201,13 +201,13 @@ HTTP RPC ENCODING
201201
}
202202

203203
var PubsubLsCmd = &cmds.Command{
204-
Status: cmds.Experimental,
204+
Status: cmds.Deprecated,
205205
Helptext: cmds.HelpText{
206206
Tagline: "List subscribed topics by name.",
207207
ShortDescription: `
208208
ipfs pubsub ls lists out the names of topics you are currently subscribed to.
209209
210-
EXPERIMENTAL FEATURE
210+
DEPRECATED FEATURE (see https://github.com/ipfs/kubo/issues/9717)
211211
212212
It is not intended in its current state to be used in a production
213213
environment. To use, the daemon must be run with
@@ -273,15 +273,15 @@ func safeTextListEncoder(req *cmds.Request, w io.Writer, list *stringList) error
273273
}
274274

275275
var PubsubPeersCmd = &cmds.Command{
276-
Status: cmds.Experimental,
276+
Status: cmds.Deprecated,
277277
Helptext: cmds.HelpText{
278278
Tagline: "List peers we are currently pubsubbing with.",
279279
ShortDescription: `
280280
ipfs pubsub peers with no arguments lists out the pubsub peers you are
281281
currently connected to. If given a topic, it will list connected peers who are
282282
subscribed to the named topic.
283283
284-
EXPERIMENTAL FEATURE
284+
DEPRECATED FEATURE (see https://github.com/ipfs/kubo/issues/9717)
285285
286286
It is not intended in its current state to be used in a production
287287
environment. To use, the daemon must be run with

docs/changelogs/v0.19.md

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- [🔦 Highlights](#-highlights)
99
- [Improving the libp2p resource management integration](#improving-the-libp2p-resource-management-integration)
1010
- [Addition of "autoclient" router type](#addition-of-autoclient-router-type)
11+
- [Deprecation of the `ipfs pubsub` commands and matching HTTP endpoints](#deprecation-of-the-ipfs-pubsub-commands-and-matching-http-endpoints)
1112
- [📝 Changelog](#-changelog)
1213
- [👨‍👩‍👧‍👦 Contributors](#-contributors)
1314

@@ -28,6 +29,12 @@ A new routing type "autoclient" has been added. This mode is similar to "auto",
2829

2930
See the [Routing.Type documentation](https://github.com/ipfs/kubo/blob/master/docs/config.md#routingtype) for more information.
3031

32+
#### Deprecation of the `ipfs pubsub` commands and matching HTTP endpoints
33+
34+
We are deprecating `ipfs pubsub` and all `/api/v0/pubsub/` endpoints and will remove them in the next release.
35+
36+
For more information and rational see [#9717](https://github.com/ipfs/kubo/issues/9717).
37+
3138
### 📝 Changelog
3239

3340
### 👨‍👩‍👧‍👦 Contributors

docs/config.md

-92
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,6 @@ config file at runtime.
9595
- [`Pinning.RemoteServices: Policies.MFS.Enabled`](#pinningremoteservices-policiesmfsenabled)
9696
- [`Pinning.RemoteServices: Policies.MFS.PinName`](#pinningremoteservices-policiesmfspinname)
9797
- [`Pinning.RemoteServices: Policies.MFS.RepinInterval`](#pinningremoteservices-policiesmfsrepininterval)
98-
- [`Pubsub`](#pubsub)
99-
- [`Pubsub.Enabled`](#pubsubenabled)
100-
- [`Pubsub.Router`](#pubsubrouter)
101-
- [`Pubsub.DisableSigning`](#pubsubdisablesigning)
102-
- [`Pubsub.SeenMessagesTTL`](#pubsubseenmessagesttl)
103-
- [`Pubsub.SeenMessagesStrategy`](#pubsubseenmessagesstrategy)
10498
- [`Peering`](#peering)
10599
- [`Peering.Peers`](#peeringpeers)
106100
- [`Reprovider`](#reprovider)
@@ -1163,92 +1157,6 @@ Default: `"5m"`
11631157

11641158
Type: `duration`
11651159

1166-
## `Pubsub`
1167-
1168-
Pubsub configures the `ipfs pubsub` subsystem. To use, it must be enabled by
1169-
passing the `--enable-pubsub-experiment` flag to the daemon
1170-
or via the `Pubsub.Enabled` flag below.
1171-
1172-
### `Pubsub.Enabled`
1173-
1174-
**EXPERIMENTAL:** read about current limitations at [experimental-features.md#ipfs-pubsub](./experimental-features.md#ipfs-pubsub).
1175-
1176-
Enables the pubsub system.
1177-
1178-
Default: `false`
1179-
1180-
Type: `flag`
1181-
1182-
### `Pubsub.Router`
1183-
1184-
Sets the default router used by pubsub to route messages to peers. This can be one of:
1185-
1186-
* `"floodsub"` - floodsub is a basic router that simply _floods_ messages to all
1187-
connected peers. This router is extremely inefficient but _very_ reliable.
1188-
* `"gossipsub"` - [gossipsub][] is a more advanced routing algorithm that will
1189-
build an overlay mesh from a subset of the links in the network.
1190-
1191-
Default: `"gossipsub"`
1192-
1193-
Type: `string` (one of `"floodsub"`, `"gossipsub"`, or `""` (apply default))
1194-
1195-
[gossipsub]: https://github.com/libp2p/specs/tree/master/pubsub/gossipsub
1196-
1197-
### `Pubsub.DisableSigning`
1198-
1199-
Disables message signing and signature verification. Enable this option if
1200-
you're operating in a completely trusted network.
1201-
1202-
It is _not_ safe to disable signing even if you don't care _who_ sent the
1203-
message because spoofed messages can be used to silence real messages by
1204-
intentionally re-using the real message's message ID.
1205-
1206-
Default: `false`
1207-
1208-
Type: `bool`
1209-
1210-
### `Pubsub.SeenMessagesTTL`
1211-
1212-
Controls the time window within which duplicate messages, identified by Message
1213-
ID, will be identified and won't be emitted again.
1214-
1215-
A smaller value for this parameter means that Pubsub messages in the cache will
1216-
be garbage collected sooner, which can result in a smaller cache. At the same
1217-
time, if there are slower nodes in the network that forward older messages,
1218-
this can cause more duplicates to be propagated through the network.
1219-
1220-
Conversely, a larger value for this parameter means that Pubsub messages in the
1221-
cache will be garbage collected later, which can result in a larger cache for
1222-
the same traffic pattern. However, it is less likely that duplicates will be
1223-
propagated through the network.
1224-
1225-
Default: see `TimeCacheDuration` from [go-libp2p-pubsub](https://github.com/libp2p/go-libp2p-pubsub)
1226-
1227-
Type: `optionalDuration`
1228-
1229-
### `Pubsub.SeenMessagesStrategy`
1230-
1231-
Determines how the time-to-live (TTL) countdown for deduplicating Pubsub
1232-
messages is calculated.
1233-
1234-
The Pubsub seen messages cache is a LRU cache that keeps messages for up to a
1235-
specified time duration. After this duration has elapsed, expired messages will
1236-
be purged from the cache.
1237-
1238-
The `last-seen` cache is a sliding-window cache. Every time a message is seen
1239-
again with the SeenMessagesTTL duration, its timestamp slides forward. This
1240-
keeps frequently occurring messages cached and prevents them from being
1241-
continually propagated, especially because of issues that might increase the
1242-
number of duplicate messages in the network.
1243-
1244-
The `first-seen` cache will store new messages and purge them after the
1245-
SeenMessagesTTL duration, even if they are seen multiple times within this
1246-
duration.
1247-
1248-
Default: `last-seen` (see [go-libp2p-pubsub](https://github.com/libp2p/go-libp2p-pubsub))
1249-
1250-
Type: `optionalString`
1251-
12521160
## `Peering`
12531161

12541162
Configures the peering subsystem. The peering subsystem configures Kubo to

docs/experimental-features.md

-31
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ When you add a new experimental feature to kubo or change an experimental
1212
feature, you MUST please make a PR updating this document, and link the PR in
1313
the above issue.
1414

15-
- [ipfs pubsub](#ipfs-pubsub)
1615
- [Raw leaves for unixfs files](#raw-leaves-for-unixfs-files)
1716
- [ipfs filestore](#ipfs-filestore)
1817
- [ipfs urlstore](#ipfs-urlstore)
@@ -31,36 +30,6 @@ the above issue.
3130

3231
---
3332

34-
## ipfs pubsub
35-
36-
### State
37-
38-
Candidate, disabled by default but will be enabled by default in 0.6.0.
39-
40-
### In Version
41-
42-
0.4.5 (`--enable-pubsub-experiment`)
43-
0.11.0 (`Pubsub.Enabled` flag in config)
44-
45-
### How to enable
46-
47-
Run your daemon with the `--enable-pubsub-experiment` flag
48-
or modify your ipfs config and restart the daemon:
49-
```
50-
ipfs config --json Pubsub.Enabled true
51-
```
52-
53-
Then use the `ipfs pubsub` commands.
54-
55-
NOTE: `--enable-pubsub-experiment` CLI flag overrides `Pubsub.Enabled` config.
56-
57-
Configuration documentation can be found in [kubo/docs/config.md](./config.md#pubsub)
58-
59-
### Road to being a real feature
60-
61-
- [ ] Needs to not impact peers who don't use pubsub:
62-
https://github.com/libp2p/go-libp2p-pubsub/issues/332
63-
6433
## Raw Leaves for unixfs files
6534

6635
Allows files to be added with no formatting in the leaf nodes of the graph.

0 commit comments

Comments
 (0)