@cryptotaxi247 / kubo / commits / 1f5763f78

chore: deprecate the pubsub api

Fixes #9717

Jorropo committed Mar 15, 2023 at 03:23 UTC 1f5763f7877a59e933fa729afdfbf26d253b0fe0
6 files changed +30 -45
README.md
+1 -2
@@ -12,7 +12,7 @@ Kubo was the first IPFS implementation and is the most widely used one today. Im
12 Featureset
13 - Runs an IPFS-Node as a network service
14 - [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)
16 - HTTP RPC API (`/api/v0`) to access and control the daemon
17 - IPFS's internal Webgui can be used to manage the Kubo nodes
18
@@ -381,7 +381,6 @@ Some places to get you started on the codebase:
381 - libp2p
382 - libp2p: https://github.com/libp2p/go-libp2p
383 - DHT: https://github.com/libp2p/go-libp2p-kad-dht
384 - - PubSub: https://github.com/libp2p/go-libp2p-pubsub
384 - [IPFS : The `Add` command demystified](https://github.com/ipfs/kubo/tree/master/docs/add-code-flow.md)
385
386 ### Map of Implemented Subsystems
cmd/ipfs/daemon.go
+1 -1
@@ -171,7 +171,7 @@ Headers.
171 cmds.BoolOption(enableGCKwd, "Enable automatic periodic repo garbage collection"),
172 cmds.BoolOption(adjustFDLimitKwd, "Check and raise file descriptor limits if needed").WithDefault(true),
173 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"),
175 cmds.BoolOption(enableIPNSPubSubKwd, "Enable IPNS over pubsub. Implicitly enables pubsub, overrides Ipns.UsePubsub config."),
176 cmds.BoolOption(enableMultiplexKwd, "DEPRECATED"),
177 cmds.StringOption(agentVersionSuffix, "Optional suffix to the AgentVersion presented by `ipfs id` and also advertised through BitSwap."),
core/commands/pubsub.go
+10 -10
@@ -16,14 +16,14 @@ import (
16 )
17
18 var PubsubCmd = &cmds.Command{
19 - Status: cmds.Experimental,
19 + Status: cmds.Deprecated,
20 Helptext: cmds.HelpText{
21 Tagline: "An experimental publish-subscribe system on ipfs.",
22 ShortDescription: `
23 ipfs pubsub allows you to publish messages to a given topic, and also to
24 subscribe to new messages on a given topic.
25
26 -EXPERIMENTAL FEATURE
26 +DEPRECATED FEATURE (see https://github.com/ipfs/kubo/issues/9717)
27
28 It is not intended in its current state to be used in a production
29 environment. To use, the daemon must be run with
@@ -46,13 +46,13 @@ type pubsubMessage struct {
46 }
47
48 var PubsubSubCmd = &cmds.Command{
49 - Status: cmds.Experimental,
49 + Status: cmds.Deprecated,
50 Helptext: cmds.HelpText{
51 Tagline: "Subscribe to messages on a given topic.",
52 ShortDescription: `
53 ipfs pubsub sub subscribes to messages on a given topic.
54
55 -EXPERIMENTAL FEATURE
55 +DEPRECATED FEATURE (see https://github.com/ipfs/kubo/issues/9717)
56
57 It is not intended in its current state to be used in a production
58 environment. To use, the daemon must be run with
@@ -145,14 +145,14 @@ TOPIC AND DATA ENCODING
145 }
146
147 var PubsubPubCmd = &cmds.Command{
148 - Status: cmds.Experimental,
148 + Status: cmds.Deprecated,
149 Helptext: cmds.HelpText{
150 Tagline: "Publish data to a given pubsub topic.",
151 ShortDescription: `
152 ipfs pubsub pub publishes a message to a specified topic.
153 It reads binary data from stdin or a file.
154
155 -EXPERIMENTAL FEATURE
155 +DEPRECATED FEATURE (see https://github.com/ipfs/kubo/issues/9717)
156
157 It is not intended in its current state to be used in a production
158 environment. To use, the daemon must be run with
@@ -201,13 +201,13 @@ HTTP RPC ENCODING
201 }
202
203 var PubsubLsCmd = &cmds.Command{
204 - Status: cmds.Experimental,
204 + Status: cmds.Deprecated,
205 Helptext: cmds.HelpText{
206 Tagline: "List subscribed topics by name.",
207 ShortDescription: `
208 ipfs pubsub ls lists out the names of topics you are currently subscribed to.
209
210 -EXPERIMENTAL FEATURE
210 +DEPRECATED FEATURE (see https://github.com/ipfs/kubo/issues/9717)
211
212 It is not intended in its current state to be used in a production
213 environment. To use, the daemon must be run with
@@ -273,7 +273,7 @@ func safeTextListEncoder(req *cmds.Request, w io.Writer, list *stringList) error
273 }
274
275 var PubsubPeersCmd = &cmds.Command{
276 - Status: cmds.Experimental,
276 + Status: cmds.Deprecated,
277 Helptext: cmds.HelpText{
278 Tagline: "List peers we are currently pubsubbing with.",
279 ShortDescription: `
@@ -281,7 +281,7 @@ ipfs pubsub peers with no arguments lists out the pubsub peers you are
281 currently connected to. If given a topic, it will list connected peers who are
282 subscribed to the named topic.
283
284 -EXPERIMENTAL FEATURE
284 +DEPRECATED FEATURE (see https://github.com/ipfs/kubo/issues/9717)
285
286 It is not intended in its current state to be used in a production
287 environment. To use, the daemon must be run with
docs/changelogs/v0.19.md
+7
@@ -8,6 +8,7 @@
8 - [🔦 Highlights](#-highlights)
9 - [Improving the libp2p resource management integration](#improving-the-libp2p-resource-management-integration)
10 - [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)
12 - [📝 Changelog](#-changelog)
13 - [👨‍👩‍👧‍👦 Contributors](#-contributors)
14
@@ -28,6 +29,12 @@ A new routing type "autoclient" has been added. This mode is similar to "auto",
29
30 See the [Routing.Type documentation](https://github.com/ipfs/kubo/blob/master/docs/config.md#routingtype) for more information.
31
32 +#### Deprecation of the `ipfs pubsub` commands and matching HTTP endpoints
33 +
34 +We are deprecating `ipfs pubsub` and all `/api/v0/pubsub/` RPC 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 +
38 ### 📝 Changelog
39
40 ### 👨‍👩‍👧‍👦 Contributors
docs/config.md
+11 -1
@@ -1165,13 +1165,15 @@ Type: `duration`
1165
1166 ## `Pubsub`
1167
1168 +**DEPRECATED**: See [#9717](https://github.com/ipfs/kubo/issues/9717)
1169 +
1170 Pubsub configures the `ipfs pubsub` subsystem. To use, it must be enabled by
1171 passing the `--enable-pubsub-experiment` flag to the daemon
1172 or via the `Pubsub.Enabled` flag below.
1173
1174 ### `Pubsub.Enabled`
1175
1174 -**EXPERIMENTAL:** read about current limitations at [experimental-features.md#ipfs-pubsub](./experimental-features.md#ipfs-pubsub).
1176 +**DEPRECATED**: See [#9717](https://github.com/ipfs/kubo/issues/9717)
1177
1178 Enables the pubsub system.
1179
@@ -1181,6 +1183,8 @@ Type: `flag`
1183
1184 ### `Pubsub.Router`
1185
1186 +**DEPRECATED**: See [#9717](https://github.com/ipfs/kubo/issues/9717)
1187 +
1188 Sets the default router used by pubsub to route messages to peers. This can be one of:
1189
1190 * `"floodsub"` - floodsub is a basic router that simply _floods_ messages to all
@@ -1196,6 +1200,8 @@ Type: `string` (one of `"floodsub"`, `"gossipsub"`, or `""` (apply default))
1200
1201 ### `Pubsub.DisableSigning`
1202
1203 +**DEPRECATED**: See [#9717](https://github.com/ipfs/kubo/issues/9717)
1204 +
1205 Disables message signing and signature verification. Enable this option if
1206 you're operating in a completely trusted network.
1207
@@ -1209,6 +1215,8 @@ Type: `bool`
1215
1216 ### `Pubsub.SeenMessagesTTL`
1217
1218 +**DEPRECATED**: See [#9717](https://github.com/ipfs/kubo/issues/9717)
1219 +
1220 Controls the time window within which duplicate messages, identified by Message
1221 ID, will be identified and won't be emitted again.
1222
@@ -1228,6 +1236,8 @@ Type: `optionalDuration`
1236
1237 ### `Pubsub.SeenMessagesStrategy`
1238
1239 +**DEPRECATED**: See [#9717](https://github.com/ipfs/kubo/issues/9717)
1240 +
1241 Determines how the time-to-live (TTL) countdown for deduplicating Pubsub
1242 messages is calculated.
1243
docs/experimental-features.md
-31
@@ -12,7 +12,6 @@ When you add a new experimental feature to kubo or change an experimental
12 feature, you MUST please make a PR updating this document, and link the PR in
13 the above issue.
14
15 -- [ipfs pubsub](#ipfs-pubsub)
15 - [Raw leaves for unixfs files](#raw-leaves-for-unixfs-files)
16 - [ipfs filestore](#ipfs-filestore)
17 - [ipfs urlstore](#ipfs-urlstore)
@@ -31,36 +30,6 @@ the above issue.
30
31 ---
32
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 -
33 ## Raw Leaves for unixfs files
34
35 Allows files to be added with no formatting in the leaf nodes of the graph.