mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 01:52:26 +08:00
docs(name/publish/resolve) help
This commit is contained in:

committed by
Juan Batiz-Benet

parent
c69ea0d6e2
commit
092e346f94
@ -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 [<name>] <ref> - Assign the <ref> to <name>
|
||||
ipfs name resolve [<name>] - Resolve the <ref> value of <name>
|
||||
|
||||
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 <name> is your own identity public key.
|
||||
|
||||
|
||||
Examples:
|
||||
|
||||
Publish a <ref> to your identity name:
|
||||
|
||||
> ipfs name publish QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
|
||||
published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
|
||||
|
||||
Publish a <ref> 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 <ref> to ipns.",
|
||||
Help: `ipfs publish [<name>] <ref> - publish a <ref> 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 <name> is your own identity public key.
|
||||
|
||||
Examples:
|
||||
|
||||
Publish a <ref> to your identity name:
|
||||
|
||||
> ipfs name publish QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
|
||||
published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
|
||||
|
||||
Publish a <ref> 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 <ref>",
|
||||
Help: `ipfs resolve [<name>] - Resolve an ipns name to a <ref>.
|
||||
|
||||
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 <name> 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},
|
||||
},
|
||||
|
Reference in New Issue
Block a user