github.com/zignig/go-ipfs@v0.0.0-20141111235910-c9e5fdf55a52/cmd/ipfs/publish.go (about) 1 package main 2 3 import ( 4 "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag" 5 "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander" 6 "github.com/jbenet/go-ipfs/core/commands" 7 ) 8 9 var cmdIpfsPub = &commander.Command{ 10 UsageLine: "publish", 11 Short: "publish a <ref> to ipns.", 12 Long: `ipfs publish [<name>] <ref> - publish a <ref> to ipns. 13 14 IPNS is a PKI namespace, where names are the hashes of public keys, and 15 the private key enables publishing new (signed) values. In publish, the 16 default value of <name> is your own identity public key. 17 18 Examples: 19 20 Publish a <ref> to your identity name: 21 22 > ipfs name publish QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy 23 published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy 24 25 Publish a <ref> to another public key: 26 27 > ipfs name publish QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy 28 published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy 29 30 `, 31 Run: pubCmd, 32 Flag: *flag.NewFlagSet("ipfs-publish", flag.ExitOnError), 33 } 34 35 var pubCmd = makeCommand(command{ 36 name: "publish", 37 args: 1, 38 flags: nil, 39 online: true, 40 cmdFn: commands.Publish, 41 })