docs(name/publish/resolve) help
Brian Tiger Chow committed
Nov 7, 2014 at 18:47 UTC
092e346f9494ddb5341d404dce746727d14e89cb
1 file changed
+79
-2
core/commands2/name.go
+79
-2
@@ -23,7 +23,41 @@ type ResolveOutput struct {
23
var errNotOnline = errors.New("This command must be run in online mode. Try running 'ipfs daemon' first.")
24
25
var nameCmd = &cmds.Command{
26
- Help: "TODO",
26
+ // TODO UsageLine: "name [publish | resolve]",
27
+ // TODO Short: "ipfs namespace (ipns) tool",
28
+ Help: `ipfs name - Get/Set ipfs config values.
29
+
30
+ ipfs name publish [<name>] <ref> - Assign the <ref> to <name>
31
+ ipfs name resolve [<name>] - Resolve the <ref> value of <name>
32
+
33
+IPNS is a PKI namespace, where names are the hashes of public keys, and
34
+the private key enables publishing new (signed) values. In both publish
35
+and resolve, the default value of <name> is your own identity public key.
36
+
37
+
38
+Examples:
39
+
40
+Publish a <ref> to your identity name:
41
+
42
+ > ipfs name publish QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
43
+ published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
44
+
45
+Publish a <ref> to another public key:
46
+
47
+ > ipfs name publish QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
48
+ published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
49
+
50
+Resolve the value of your identity:
51
+
52
+ > ipfs name resolve
53
+ QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
54
+
55
+Resolve te value of another name:
56
+
57
+ > ipfs name resolve QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n
58
+ QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
59
+
60
+`,
61
Subcommands: map[string]*cmds.Command{
62
"publish": publishCmd,
63
"resolve": resolveCmd,
@@ -31,11 +65,31 @@ var nameCmd = &cmds.Command{
65
}
66
67
var publishCmd = &cmds.Command{
68
+ // TODO UsageLine: "publish",
69
+ // TODO Short: "publish a <ref> to ipns.",
70
+ Help: `ipfs publish [<name>] <ref> - publish a <ref> to ipns.
71
+
72
+IPNS is a PKI namespace, where names are the hashes of public keys, and
73
+the private key enables publishing new (signed) values. In publish, the
74
+default value of <name> is your own identity public key.
75
+
76
+Examples:
77
+
78
+Publish a <ref> to your identity name:
79
+
80
+ > ipfs name publish QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
81
+ published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
82
+
83
+Publish a <ref> to another public key:
84
+
85
+ > ipfs name publish QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
86
+ published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
87
+
88
+`,
89
Arguments: []cmds.Argument{
90
cmds.Argument{"name", cmds.ArgString, false, false},
91
cmds.Argument{"object", cmds.ArgString, true, false},
92
},
38
- Help: "TODO",
93
Run: func(res cmds.Response, req cmds.Request) {
94
n := req.Context().Node
95
args := req.Arguments()
@@ -85,6 +139,29 @@ var publishCmd = &cmds.Command{
139
}
140
141
var resolveCmd = &cmds.Command{
142
+ // TODO UsageLine: "resolve",
143
+ // TODO Short: "resolve an ipns name to a <ref>",
144
+ Help: `ipfs resolve [<name>] - Resolve an ipns name to a <ref>.
145
+
146
+IPNS is a PKI namespace, where names are the hashes of public keys, and
147
+the private key enables publishing new (signed) values. In resolve, the
148
+default value of <name> is your own identity public key.
149
+
150
+
151
+Examples:
152
+
153
+Resolve the value of your identity:
154
+
155
+ > ipfs name resolve
156
+ QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
157
+
158
+Resolve te value of another name:
159
+
160
+ > ipfs name resolve QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n
161
+ QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
162
+
163
+`,
164
+
165
Arguments: []cmds.Argument{
166
cmds.Argument{"name", cmds.ArgString, false, true},
167
},