From 092e346f9494ddb5341d404dce746727d14e89cb Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Fri, 7 Nov 2014 18:47:51 -0800 Subject: [PATCH] docs(name/publish/resolve) help --- core/commands2/name.go | 81 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 79 insertions(+), 2 deletions(-) diff --git a/core/commands2/name.go b/core/commands2/name.go index 4a9bc7997..3d1d0ab56 100644 --- a/core/commands2/name.go +++ b/core/commands2/name.go @@ -23,7 +23,41 @@ type ResolveOutput struct { var errNotOnline = errors.New("This command must be run in online mode. Try running 'ipfs daemon' first.") var nameCmd = &cmds.Command{ - Help: "TODO", + // TODO UsageLine: "name [publish | resolve]", + // TODO Short: "ipfs namespace (ipns) tool", + Help: `ipfs name - Get/Set ipfs config values. + + ipfs name publish [] - Assign the to + ipfs name resolve [] - Resolve the value of + +IPNS is a PKI namespace, where names are the hashes of public keys, and +the private key enables publishing new (signed) values. In both publish +and resolve, the default value of is your own identity public key. + + +Examples: + +Publish a to your identity name: + + > ipfs name publish QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy + published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy + +Publish a to another public key: + + > ipfs name publish QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy + published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy + +Resolve the value of your identity: + + > ipfs name resolve + QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy + +Resolve te value of another name: + + > ipfs name resolve QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n + QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy + +`, Subcommands: map[string]*cmds.Command{ "publish": publishCmd, "resolve": resolveCmd, @@ -31,11 +65,31 @@ var nameCmd = &cmds.Command{ } var publishCmd = &cmds.Command{ + // TODO UsageLine: "publish", + // TODO Short: "publish a to ipns.", + Help: `ipfs publish [] - publish a to ipns. + +IPNS is a PKI namespace, where names are the hashes of public keys, and +the private key enables publishing new (signed) values. In publish, the +default value of is your own identity public key. + +Examples: + +Publish a to your identity name: + + > ipfs name publish QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy + published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy + +Publish a to another public key: + + > ipfs name publish QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy + published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy + +`, Arguments: []cmds.Argument{ cmds.Argument{"name", cmds.ArgString, false, false}, cmds.Argument{"object", cmds.ArgString, true, false}, }, - Help: "TODO", Run: func(res cmds.Response, req cmds.Request) { n := req.Context().Node args := req.Arguments() @@ -85,6 +139,29 @@ var publishCmd = &cmds.Command{ } var resolveCmd = &cmds.Command{ + // TODO UsageLine: "resolve", + // TODO Short: "resolve an ipns name to a ", + Help: `ipfs resolve [] - Resolve an ipns name to a . + +IPNS is a PKI namespace, where names are the hashes of public keys, and +the private key enables publishing new (signed) values. In resolve, the +default value of is your own identity public key. + + +Examples: + +Resolve the value of your identity: + + > ipfs name resolve + QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy + +Resolve te value of another name: + + > ipfs name resolve QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n + QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy + +`, + Arguments: []cmds.Argument{ cmds.Argument{"name", cmds.ArgString, false, true}, },