ipfs-inactive/faq

List all items stored on ipfs and corresponding hash value

Closed this issue · 10 comments

When add an item to ipfs a hash value of the item is returned.
This hash value is used to access the item via a browser using ipfs.

The item cannot be accessed from ipfs unless have it's hash value?

Is there a command to list all items stores on ipfs including each hash value ?

Yes, the only way to access it is with that hash. You need to know the hash of the content you want to access that content.

There is no list of available hashes either. No one has that information because that information is distributed throughout the IPFS network. It's not in any one place.

try ipfs refs local to list all refs local to a node. of course, we need better porcelain commands

Same logic extends for command 'ipfs init' , in this case a hash of the ipfs content added at root level is returned and I need to also know this hash in order to access this content ?

@adrian-git-hub-user That hash returned is the hash of your public key. The hash of your public key is special because it's your IPNS address, it's kinda your name on the IPFS network.

vagrant@vagrant-ubuntu-wily-64:~/go-ipfs$ ipfs init
initializing ipfs node at /home/vagrant/.ipfs
generating 2048-bit RSA keypair...done
peer identity: QmejGNNbBk62b51KVXCYNJKjPnhx7t6BckAzicSqKKqRtE
to get started, enter:

    ipfs cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme

vagrant@vagrant-ubuntu-wily-64:~/go-ipfs$ ipfs daemon&
[1] 2486
vagrant@vagrant-ubuntu-wily-64:~/go-ipfs$ Initializing daemon...
ipfs get Swarm listening on /ip4/10.0.2.15/tcp/4001
Swarm listening on /ip4/10.0.3.1/tcp/4001
Swarm listening on /ip4/10.10.100.6/tcp/4001
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Daemon is ready
vagrant@vagrant-ubuntu-wily-64:~/go-ipfs$ ipfs name publish /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme
Published to QmejGNNbBk62b51KVXCYNJKjPnhx7t6BckAzicSqKKqRtE: /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme
vagrant@vagrant-ubuntu-wily-64:~/go-ipfs$ ipfs name resolve QmejGNNbBk62b51KVXCYNJKjPnhx7t6BckAzicSqKKqRtE
/ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme
vagrant@vagrant-ubuntu-wily-64:~/go-ipfs$ 

in fact, you can go there yourself and see the content I published here: https://ipfs.io/ipns/QmejGNNbBk62b51KVXCYNJKjPnhx7t6BckAzicSqKKqRtE

or run the same command: ipfs name resolve QmejGNNbBk62b51KVXCYNJKjPnhx7t6BckAzicSqKKqRtE

If someone knows your name, they can resolve it to find out the content you have pointed to. IPNS is a whole nother can of worms of IPFS, I'm not sure what it's future holds or how much of this will remain true.

Thanks, @adrian-git-hub-user!

I am going to keep this open for others to see, if that's OK.

@Ghoughpteighbteau

If someone knows your name, they can resolve it to find out the content you have pointer to.

Well, that's not quite true. If you're connected to the network at all, and have something pinned to your peer identity (public key hash), anybody can find it. It's fairly easy to enumerate a large part of the IPFS network for IPNS records using addresses accumulated in ipfs swarm addrs.
The last time I did this, I found about 10 hashes that weren't the empty directory, I only checked the first two, both being blogs.

@mateon1

? I wasn't... actually I'm not sure what you think I was wrong about. Maybe you figured I was insinuating that your IPNS name was essentially secret unless you told someone.

It's fairly easy to enumerate a large part of the IPFS network for IPNS records using addresses accumulated in ipfs swarm addrs.

haha, what a fun exercise. Here's what I've found doing that:

http://ipfs.io/ipfs/QmXcDGvp2w9Bu84pQujZQyntyCtymvy4N4UBAEzxS14Bnv/img/archlinux-installation-cheat-sheet.jpg
http://ipfs.io/ipfs/ipfs/QmU2ywYUuLd97uCfo1dknZosB6Qem7e32JQuMtBDUkoxu3/3298548.jpg
http://ipfs.io/ipfs/ipfs/QmU2ywYUuLd97uCfo1dknZosB6Qem7e32JQuMtBDUkoxu3/3351800.jpg
http://ipfs.io/ipfs/ipfs/QmTeVUJb41cHyLi6AT7t5Hrh8swyR1uRiU6JTLJZUhujuH/BreakingOfTheDay.mp3

aaand some blogs.

edit:

I made a some commands to make this easy!

run this to resolve the list of your peers:
ipfs swarm peers | sed "s:.*/ipfs/\(.*\)\$:\1:g" | xargs -n1 -P5 ipfs name resolve > peers

then this to open them!
cat peers | grep -v "/ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn" | sed "s|^|http://127.0.0.1:8080|" | xargs firefox

@adrian-git-hub-user That hash returned is the hash of your public key. The hash of your public key is special because it's your IPNS address, it's kinda your name on the IPFS network.

vagrant@vagrant-ubuntu-wily-64:~/go-ipfs$ ipfs init
initializing ipfs node at /home/vagrant/.ipfs
generating 2048-bit RSA keypair...done
peer identity: QmejGNNbBk62b51KVXCYNJKjPnhx7t6BckAzicSqKKqRtE
to get started, enter:

    ipfs cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme

vagrant@vagrant-ubuntu-wily-64:~/go-ipfs$ ipfs daemon&
[1] 2486
vagrant@vagrant-ubuntu-wily-64:~/go-ipfs$ Initializing daemon...
ipfs get Swarm listening on /ip4/10.0.2.15/tcp/4001
Swarm listening on /ip4/10.0.3.1/tcp/4001
Swarm listening on /ip4/10.10.100.6/tcp/4001
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Daemon is ready
vagrant@vagrant-ubuntu-wily-64:~/go-ipfs$ ipfs name publish /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme
Published to QmejGNNbBk62b51KVXCYNJKjPnhx7t6BckAzicSqKKqRtE: /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme
vagrant@vagrant-ubuntu-wily-64:~/go-ipfs$ ipfs name resolve QmejGNNbBk62b51KVXCYNJKjPnhx7t6BckAzicSqKKqRtE
/ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme
vagrant@vagrant-ubuntu-wily-64:~/go-ipfs$ 

in fact, you can go there yourself and see the content I published here: https://ipfs.io/ipns/QmejGNNbBk62b51KVXCYNJKjPnhx7t6BckAzicSqKKqRtE

or run the same command: ipfs name resolve QmejGNNbBk62b51KVXCYNJKjPnhx7t6BckAzicSqKKqRtE

If someone knows your name, they can resolve it to find out the content you have pointed to. IPNS is a whole nother can of worms of IPFS, I'm not sure what it's future holds or how much of this will remain true.

Hi, I noticed you re making use of Vagrant to run IPFS. Have you made any specific configuration to access the webui from the host machine? Because I have not been able to do so.