github.com/keltia/go-ipfs@v0.3.8-0.20150909044612-210793031c63/core/commands/name.go (about)

     1  package commands
     2  
     3  import cmds "github.com/ipfs/go-ipfs/commands"
     4  
     5  type IpnsEntry struct {
     6  	Name  string
     7  	Value string
     8  }
     9  
    10  var NameCmd = &cmds.Command{
    11  	Helptext: cmds.HelpText{
    12  		Tagline: "IPFS namespace (IPNS) tool",
    13  		Synopsis: `
    14  ipfs name publish [<name>] <ipfs-path> - Publish an object to IPNS
    15  ipfs name resolve [<name>]             - Gets the value currently published at an IPNS name
    16  `,
    17  		ShortDescription: `
    18  IPNS is a PKI namespace, where names are the hashes of public keys, and
    19  the private key enables publishing new (signed) values. In both publish
    20  and resolve, the default value of <name> is your own identity public key.
    21  `,
    22  		LongDescription: `
    23  IPNS is a PKI namespace, where names are the hashes of public keys, and
    24  the private key enables publishing new (signed) values. In both publish
    25  and resolve, the default value of <name> is your own identity public key.
    26  
    27  
    28  Examples:
    29  
    30  Publish an <ipfs-path> to your identity name:
    31  
    32    > ipfs name publish /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
    33    Published to QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n: /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
    34  
    35  Publish an <ipfs-path> to another public key:
    36  
    37    > ipfs name publish /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n
    38    Published to QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n: /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
    39  
    40  Resolve the value of your identity:
    41  
    42    > ipfs name resolve
    43    /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
    44  
    45  Resolve the value of another name:
    46  
    47    > ipfs name resolve QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n
    48    /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
    49  
    50  `,
    51  	},
    52  
    53  	Subcommands: map[string]*cmds.Command{
    54  		"publish": PublishCmd,
    55  		"resolve": IpnsCmd,
    56  	},
    57  }