resolve.go 1.06 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
package main

import (
	"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
	"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander"
	"github.com/jbenet/go-ipfs/core/commands"
)

var cmdIpfsResolve = &commander.Command{
	UsageLine: "resolve",
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
	Short:     "resolve an ipns name to a <ref>",
	Long: `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
30 31 32 33 34 35

`,
	Run:  resolveCmd,
	Flag: *flag.NewFlagSet("ipfs-resolve", flag.ExitOnError),
}

36 37
var resolveCmd = makeCommand(command{
	name:   "resolve",
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
38
	args:   0,
39 40 41 42
	flags:  nil,
	online: true,
	cmdFn:  commands.Resolve,
})