You are viewing a single comment's thread from:

RE: Publishing to IPFS

in #development7 years ago (edited)

What am I doing wrong ?

$ ipfs daemon
$ ipfs add -r /Users/m/Desktop/img_test 

added QmcDQDePjtXyS28aRFHuSXBiGifcL8jdihhDvvt3nteYww img_test/IMG_8831.jpg
added QmeT1dXQsGVGDgt5A2vQLDbMS4sPr1KsZG3vBKGnANRvtM img_test/IMG_8834.jpg
added QmbAqf4gCDqJAaWN5ZfaMz4yoBEkL2Z9ivcusHy8wpXTbA img_test

$ ipfs name publish QmbAqf4gCDqJAaWN5ZfaMz4yoBEkL2Z9ivcusHy8wpXTbA img_test
Error: Unknown Command "QmbAqf4gCDqJAaWN5ZfaMz4yoBEkL2Z9ivcusHy8wpXTbA"

Sort:  

you don't need to specify a path:
ipfs name publish QmbAqf4gCDqJAaWN5ZfaMz4yoBEkL2Z9ivcusHy8wpXTbA

just
$ ipfs name publish img_test ?

ps: can i create directory ?

Nope, as I written above, no directory name, just the hash of it.
When you publish, you specify exactly one hash.
If you want directories, put them in the tree: example:

mkdir -p a/b/c
echo hello > a/b/c/hello.txt
ipfs add -r a
… SOMEHASH
ipfs name publish SOMEHASH

you will then find the CONTENT of a (note that the name of a will not appear anywhere): so you will find the directory b, which includes the directory c, which includes hello.txt
if you modify the content of a, just add it again, and publish the new hash.

Coin Marketplace

STEEM 0.28
TRX 0.21
JST 0.039
BTC 96371.79
ETH 3682.82
SBD 3.84