Skip to content

Commit a61c53f

Browse files
lidelschomatis
andauthored
feat(cmds): document deprecated RPC API commands (#8802)
* feat(cmds): add deprecated and experimental status Added programmatic state annotation introduced in ipfs/go-ipfs-cmds#225 for already deprecated / experimental commands. * chore: go-ipfs-cmds v0.7.0 Co-authored-by: Lucas Molas <schomatis@gmail.com>
1 parent c854390 commit a61c53f

File tree

13 files changed

+43
-15
lines changed

13 files changed

+43
-15
lines changed

core/commands/dag/dag.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ var DagCmd = &cmds.Command{
3030
ShortDescription: `
3131
'ipfs dag' is used for creating and manipulating DAG objects/hierarchies.
3232
33-
This subcommand is currently an experimental feature, but it is intended
34-
to deprecate and replace the existing 'ipfs object' command moving forward.
35-
`,
33+
This subcommand is intended to deprecate and replace
34+
the existing 'ipfs object' command moving forward.
35+
`,
3636
},
3737
Subcommands: map[string]*cmds.Command{
3838
"put": DagPutCmd,

core/commands/name/ipnsps.go

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ type stringList struct {
2626

2727
// IpnsPubsubCmd is the subcommand that allows us to manage the IPNS pubsub system
2828
var IpnsPubsubCmd = &cmds.Command{
29+
Status: cmds.Experimental,
2930
Helptext: cmds.HelpText{
3031
Tagline: "IPNS pubsub management",
3132
ShortDescription: `
@@ -42,6 +43,7 @@ Note: this command is experimental and subject to change as the system is refine
4243
}
4344

4445
var ipnspsStateCmd = &cmds.Command{
46+
Status: cmds.Experimental,
4547
Helptext: cmds.HelpText{
4648
Tagline: "Query the state of IPNS pubsub.",
4749
},
@@ -70,6 +72,7 @@ var ipnspsStateCmd = &cmds.Command{
7072
}
7173

7274
var ipnspsSubsCmd = &cmds.Command{
75+
Status: cmds.Experimental,
7376
Helptext: cmds.HelpText{
7477
Tagline: "Show current name subscriptions.",
7578
},
@@ -114,6 +117,7 @@ var ipnspsSubsCmd = &cmds.Command{
114117
}
115118

116119
var ipnspsCancelCmd = &cmds.Command{
120+
Status: cmds.Experimental,
117121
Helptext: cmds.HelpText{
118122
Tagline: "Cancel a name subscription.",
119123
},

core/commands/object/diff.go

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type Changes struct {
2020
}
2121

2222
var ObjectDiffCmd = &cmds.Command{
23+
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/7936
2324
Helptext: cmds.HelpText{
2425
Tagline: "Display the diff between two IPFS objects.",
2526
ShortDescription: `

core/commands/object/object.go

+7
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const (
4747
)
4848

4949
var ObjectCmd = &cmds.Command{
50+
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/7936
5051
Helptext: cmds.HelpText{
5152
Tagline: "Deprecated commands to interact with dag-pb objects. Use 'dag' or 'files' instead.",
5253
ShortDescription: `
@@ -68,6 +69,7 @@ directly. Deprecated, use more modern 'ipfs dag' and 'ipfs files' instead.`,
6869

6970
// ObjectDataCmd object data command
7071
var ObjectDataCmd = &cmds.Command{
72+
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/7936
7173
Helptext: cmds.HelpText{
7274
Tagline: "Deprecated way to read the raw bytes of a dag-pb object: use 'dag get' instead.",
7375
ShortDescription: `
@@ -107,6 +109,7 @@ is the raw data of the object.
107109

108110
// ObjectLinksCmd object links command
109111
var ObjectLinksCmd = &cmds.Command{
112+
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/7936
110113
Helptext: cmds.HelpText{
111114
Tagline: "Deprecated way to output links in the specified dag-pb object: use 'dag get' instead.",
112115
ShortDescription: `
@@ -181,6 +184,7 @@ multihash. Provided for legacy reasons. Use 'ipfs dag get' instead.
181184

182185
// ObjectGetCmd object get command
183186
var ObjectGetCmd = &cmds.Command{
187+
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/7936
184188
Helptext: cmds.HelpText{
185189
Tagline: "Deprecated way to get and serialize the dag-pb node. Use 'dag get' instead",
186190
ShortDescription: `
@@ -272,6 +276,7 @@ DEPRECATED and provided for legacy reasons. Use 'ipfs dag get' instead.
272276

273277
// ObjectStatCmd object stat command
274278
var ObjectStatCmd = &cmds.Command{
279+
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/7936
275280
Helptext: cmds.HelpText{
276281
Tagline: "Deprecated way to read stats for the dag-pb node. Use 'files stat' instead.",
277282
ShortDescription: `
@@ -371,6 +376,7 @@ DEPRECATED: Provided for legacy reasons. Modern replacements:
371376

372377
// ObjectPutCmd object put command
373378
var ObjectPutCmd = &cmds.Command{
379+
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/7936
374380
Helptext: cmds.HelpText{
375381
Tagline: "Deprecated way to store input as a DAG object. Use 'dag put' instead.",
376382
ShortDescription: `
@@ -450,6 +456,7 @@ DEPRECATED and provided for legacy reasons. Use 'ipfs dag put' instead.
450456

451457
// ObjectNewCmd object new command
452458
var ObjectNewCmd = &cmds.Command{
459+
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/7936
453460
Helptext: cmds.HelpText{
454461
Tagline: "Deprecated way to create a new dag-pb object from a template.",
455462
ShortDescription: `

core/commands/object/patch.go

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
)
1414

1515
var ObjectPatchCmd = &cmds.Command{
16+
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/7936
1617
Helptext: cmds.HelpText{
1718
Tagline: "Deprecated way to create a new merkledag object based on an existing one. Use MFS with 'files cp|rm' instead.",
1819
ShortDescription: `
@@ -48,6 +49,7 @@ For modern use cases, use MFS with 'files' commands: 'ipfs files --help'.
4849
}
4950

5051
var patchAppendDataCmd = &cmds.Command{
52+
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/7936
5153
Helptext: cmds.HelpText{
5254
Tagline: "Deprecated way to append data to the data segment of a DAG node.",
5355
ShortDescription: `
@@ -102,6 +104,7 @@ DEPRECATED and provided for legacy reasons. Use 'ipfs add' or 'ipfs files' inste
102104
}
103105

104106
var patchSetDataCmd = &cmds.Command{
107+
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/7936
105108
Helptext: cmds.HelpText{
106109
Tagline: "Deprecated way to set the data field of dag-pb object.",
107110
ShortDescription: `
@@ -152,6 +155,7 @@ DEPRECATED and provided for legacy reasons. Use 'files cp' and 'dag put' instead
152155
}
153156

154157
var patchRmLinkCmd = &cmds.Command{
158+
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/7936
155159
Helptext: cmds.HelpText{
156160
Tagline: "Deprecated way to remove a link from dag-pb object.",
157161
ShortDescription: `
@@ -198,6 +202,7 @@ const (
198202
)
199203

200204
var patchAddLinkCmd = &cmds.Command{
205+
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/7936
201206
Helptext: cmds.HelpText{
202207
Tagline: "Deprecated way to add a link to a given dag-pb.",
203208
ShortDescription: `

core/commands/p2p.go

+8
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ var resolveTimeout = 10 * time.Second
5959

6060
// P2PCmd is the 'ipfs p2p' command
6161
var P2PCmd = &cmds.Command{
62+
Status: cmds.Experimental,
6263
Helptext: cmds.HelpText{
6364
Tagline: "Libp2p stream mounting.",
6465
ShortDescription: `
@@ -78,6 +79,7 @@ are refined`,
7879
}
7980

8081
var p2pForwardCmd = &cmds.Command{
82+
Status: cmds.Experimental,
8183
Helptext: cmds.HelpText{
8284
Tagline: "Forward connections to libp2p service.",
8385
ShortDescription: `
@@ -179,6 +181,7 @@ func parseIpfsAddr(addr string) (*peer.AddrInfo, error) {
179181
}
180182

181183
var p2pListenCmd = &cmds.Command{
184+
Status: cmds.Experimental,
182185
Helptext: cmds.HelpText{
183186
Tagline: "Create libp2p service.",
184187
ShortDescription: `
@@ -280,6 +283,7 @@ const (
280283
)
281284

282285
var p2pLsCmd = &cmds.Command{
286+
Status: cmds.Experimental,
283287
Helptext: cmds.HelpText{
284288
Tagline: "List active p2p listeners.",
285289
},
@@ -343,6 +347,7 @@ const (
343347
)
344348

345349
var p2pCloseCmd = &cmds.Command{
350+
Status: cmds.Experimental,
346351
Helptext: cmds.HelpText{
347352
Tagline: "Stop listening for new connections to forward.",
348353
},
@@ -427,6 +432,7 @@ var p2pCloseCmd = &cmds.Command{
427432

428433
// p2pStreamCmd is the 'ipfs p2p stream' command
429434
var p2pStreamCmd = &cmds.Command{
435+
Status: cmds.Experimental,
430436
Helptext: cmds.HelpText{
431437
Tagline: "P2P stream management.",
432438
ShortDescription: "Create and manage p2p streams",
@@ -439,6 +445,7 @@ var p2pStreamCmd = &cmds.Command{
439445
}
440446

441447
var p2pStreamLsCmd = &cmds.Command{
448+
Status: cmds.Experimental,
442449
Helptext: cmds.HelpText{
443450
Tagline: "List active p2p streams.",
444451
},
@@ -488,6 +495,7 @@ var p2pStreamLsCmd = &cmds.Command{
488495
}
489496

490497
var p2pStreamCloseCmd = &cmds.Command{
498+
Status: cmds.Experimental,
491499
Helptext: cmds.HelpText{
492500
Tagline: "Close active p2p stream.",
493501
},

core/commands/pubsub.go

+5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
)
1818

1919
var PubsubCmd = &cmds.Command{
20+
Status: cmds.Experimental,
2021
Helptext: cmds.HelpText{
2122
Tagline: "An experimental publish-subscribe system on ipfs.",
2223
ShortDescription: `
@@ -46,6 +47,7 @@ type pubsubMessage struct {
4647
}
4748

4849
var PubsubSubCmd = &cmds.Command{
50+
Status: cmds.Experimental,
4951
Helptext: cmds.HelpText{
5052
Tagline: "Subscribe to messages on a given topic.",
5153
ShortDescription: `
@@ -144,6 +146,7 @@ TOPIC AND DATA ENCODING
144146
}
145147

146148
var PubsubPubCmd = &cmds.Command{
149+
Status: cmds.Experimental,
147150
Helptext: cmds.HelpText{
148151
Tagline: "Publish data to a given pubsub topic.",
149152
ShortDescription: `
@@ -199,6 +202,7 @@ HTTP RPC ENCODING
199202
}
200203

201204
var PubsubLsCmd = &cmds.Command{
205+
Status: cmds.Experimental,
202206
Helptext: cmds.HelpText{
203207
Tagline: "List subscribed topics by name.",
204208
ShortDescription: `
@@ -270,6 +274,7 @@ func safeTextListEncoder(req *cmds.Request, w io.Writer, list *stringList) error
270274
}
271275

272276
var PubsubPeersCmd = &cmds.Command{
277+
Status: cmds.Experimental,
273278
Helptext: cmds.HelpText{
274279
Tagline: "List peers we are currently pubsubbing with.",
275280
ShortDescription: `

core/commands/repo.go

+1
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ Version string The repo version.
222222
}
223223

224224
var repoFsckCmd = &cmds.Command{
225+
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/issues/6435
225226
Helptext: cmds.HelpText{
226227
Tagline: "Remove repo lockfiles.",
227228
ShortDescription: `

core/commands/unixfs/ls.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ type LsOutput struct {
3333
}
3434

3535
var LsCmd = &cmds.Command{
36+
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/pull/7755
3637
Helptext: cmds.HelpText{
37-
Tagline: "List directory contents for Unix filesystem objects. Deprecated: Use 'ipfs ls' instead.",
38+
Tagline: "List directory contents for Unix filesystem objects. Deprecated: Use 'ipfs ls' and 'ipfs files ls' instead.",
3839
ShortDescription: `
3940
Displays the contents of an IPFS or IPNS object(s) at the given path.
4041

core/commands/unixfs/unixfs.go

+3-8
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,12 @@ import (
55
)
66

77
var UnixFSCmd = &cmds.Command{
8+
Status: cmds.Deprecated, // https://github.com/ipfs/go-ipfs/pull/7755
89
Helptext: cmds.HelpText{
910
Tagline: "Interact with IPFS objects representing Unix filesystems.",
1011
ShortDescription: `
11-
'ipfs file' provides a familiar interface to file systems represented
12-
by IPFS objects, which hides ipfs implementation details like layout
13-
objects (e.g. fanout and chunking).
14-
`,
15-
LongDescription: `
16-
'ipfs file' provides a familiar interface to file systems represented
17-
by IPFS objects, which hides ipfs implementation details like layout
18-
objects (e.g. fanout and chunking).
12+
Old interface to file systems represented by UnixFS.
13+
Superseded by modern alternatives: 'ipfs ls' and 'ipfs files'
1914
`,
2015
},
2116

core/commands/urlstore.go

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ var urlStoreCmd = &cmds.Command{
2323
}
2424

2525
var urlAdd = &cmds.Command{
26+
Status: cmds.Deprecated,
2627
Helptext: cmds.HelpText{
2728
Tagline: "Add URL via urlstore.",
2829
LongDescription: `

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ require (
3131
github.com/ipfs/go-graphsync v0.11.0
3232
github.com/ipfs/go-ipfs-blockstore v1.2.0
3333
github.com/ipfs/go-ipfs-chunker v0.0.5
34-
github.com/ipfs/go-ipfs-cmds v0.6.0
34+
github.com/ipfs/go-ipfs-cmds v0.7.0
3535
github.com/ipfs/go-ipfs-exchange-interface v0.1.0
3636
github.com/ipfs/go-ipfs-exchange-offline v0.2.0
3737
github.com/ipfs/go-ipfs-files v0.0.9

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,8 @@ github.com/ipfs/go-ipfs-blocksutil v0.0.1/go.mod h1:Yq4M86uIOmxmGPUHv/uI7uKqZNtL
473473
github.com/ipfs/go-ipfs-chunker v0.0.1/go.mod h1:tWewYK0we3+rMbOh7pPFGDyypCtvGcBFymgY4rSDLAw=
474474
github.com/ipfs/go-ipfs-chunker v0.0.5 h1:ojCf7HV/m+uS2vhUGWcogIIxiO5ubl5O57Q7NapWLY8=
475475
github.com/ipfs/go-ipfs-chunker v0.0.5/go.mod h1:jhgdF8vxRHycr00k13FM8Y0E+6BoalYeobXmUyTreP8=
476-
github.com/ipfs/go-ipfs-cmds v0.6.0 h1:yAxdowQZzoFKjcLI08sXVNnqVj3jnABbf9smrPQmBsw=
477-
github.com/ipfs/go-ipfs-cmds v0.6.0/go.mod h1:ZgYiWVnCk43ChwoH8hAmI1IRbuVtq3GSTHwtRB/Kqhk=
476+
github.com/ipfs/go-ipfs-cmds v0.7.0 h1:0lEldmB7C83RxIOer38Sv1ob6wIoCAIEOaxiYgcv7wA=
477+
github.com/ipfs/go-ipfs-cmds v0.7.0/go.mod h1:y0bflH6m4g6ary4HniYt98UqbrVnRxmRarzeMdLIUn0=
478478
github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw=
479479
github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ=
480480
github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw=

0 commit comments

Comments
 (0)