Significance of key generated by 'ipfs init'

From @aronayne on Thu Aug 25 2016 21:28:36 GMT+0000 (UTC)

Following doc https://ipfs.io/docs/getting-started/ what is the ‘peer identity’ hash key , this is required to store files on ipfs ?

From ‘getting started’ doc
peer identity: Qmcpo2iLBikrdf1d6QU6vXuNb6P7hwrbNPW9kLAH8eG67z
to get started, enter:
ipfs cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme
Should each of these keys contain same value ?

Once I ‘ipfs init’ and close terminal is the hash key stored on system so can re-access or is it required by user to securely store ?


Copied from original issue: https://github.com/ipfs/faq/issues/166

From @Ghoughpteighbteau on Thu Aug 25 2016 23:28:03 GMT+0000 (UTC)

check out ~/.ipfs/config

ipfs init generated the files in ~/.ipfs/, including config, which contains your private key. You’ll notice that in config your peer identity is listed above that private key.

ipfs cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme is just a nice example command you can run to prove that things are working, but before you run that, make sure the ipfs daemon is running.

like this:

~ $ ipfs daemon&
~ $ Initializing daemon...
Swarm listening on /ip4/10.10.100.12/tcp/4001
Swarm listening on /ip4/10.10.100.155/tcp/4001
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/199.192.105.247/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/8079
Daemon is ready
~ $ ipfs cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme
Hello and Welcome to IPFS!

...

So, the peer identity is the thing that identifies you on the network, and it gets used as your address in IPNS.

~ $ ipfs swarm peers
/ip4/104.223.59.174/tcp/4001/ipfs/QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6
/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx
/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z
/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM
/ip4/156.56.178.133/tcp/4001/ipfs/QmVjH4F65fnqy1GkBBYiuAkdazKzYsw3LbMVANGFeBGB8e
/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm
/ip4/163.172.135.245/tcp/4001/ipfs/QmTCoBtUYASLvBunWwYem5gTsD5ovNmMZjsRaHto8vP6bh
/ip4/164.132.197.107/tcp/4001/ipfs/QmaxqKpiYNr62uSFBhxJAMmEMkT6dvc3oHkrZNpH2VMTLZ
/ip4/174.24.145.222/tcp/12644/ipfs/QmUWKoHbjsqsSMesRC2Zoscs8edyFz6F77auBB1YBVhgpX
/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd
/ip4/202.171.186.123/tcp/21216/ipfs/QmfJmN62s33FGjh2XcLp3LVXEaXJszcGdUctvx7J9CsDzY
/ip4/5.9.90.132/tcp/4001/ipfs/QmQDysR4PLWAADFFns6sBbsknbvMkRqdYBgMRyHDgbWyMG
/ip4/52.43.73.237/tcp/4001/ipfs/QmRexKsvb2YZrceyU6FoYxFDEZKRYcwRburWiRarGURsTQ
/ip4/54.236.205.6/tcp/4001/ipfs/QmfXR7UwpZNgcHEwTgLH9JaJcqQ8Mioe4tJayqWNPKHJze
/ip4/65.19.134.244/tcp/4001/ipfs/QmctA1rfDq4ZiaZgCLcRFvjYdVFfH8ebzTe67bfG7cVWsZ
/ip4/67.84.161.250/tcp/4001/ipfs/QmRfvckFHNSTHFrVwRCd8svQ6mRm7dFXLYBwbUJVQQXHbY
/ip4/68.12.211.164/tcp/4001/ipfs/QmPagZcWDi2ufYc57755zE9baJhqVPgyQKSdZVoxa2YTsW
/ip4/81.236.22.69/tcp/33129/ipfs/QmXKd1pJxTqTWNgGENcX2daiGLgWRPDDsXJe8eecQCr6Vh
/ip4/91.126.205.225/tcp/56456/ipfs/QmdP9LNSHeBYH5TvRgVsCs8XyuFuKbPhpijsCxjA7PGyBH

here’s a list of peers I’m currently connected to.

QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6 is the peer identity of the first one in the list. In fact, I can resolve it!

~ $ ipfs name resolve QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6
/ipfs/QmbtNuavtRJs9BijJo7uMrRSp926F92DKMQHAjQDajMuw1

http://ipfs.io/ipfs/QmbtNuavtRJs9BijJo7uMrRSp926F92DKMQHAjQDajMuw1/

it’s a blog! :laughing:

From @aronayne on Fri Aug 26 2016 10:18:20 GMT+0000 (UTC)

thanks @Ghoughpteighbteau what is being resolved as part of ipfs name resolve QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6
/ipfs/QmbtNuavtRJs9BijJo7uMrRSp926F92DKMQHAjQDajMuw1 ? QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6 is the peer identity . Are all hash values created as part of ‘ipfs add’ for the given peer identity returned ?

From @Ghoughpteighbteau on Fri Aug 26 2016 16:27:27 GMT+0000 (UTC)

the IPNS system is taking the peer identity QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6 and resolving it. It resolved to /ipfs/QmbtNuavtRJs9BijJo7uMrRSp926F92DKMQHAjQDajMuw1

this peer identity QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6. I left something off of it because ipfs name resolve is OK with it. but that’s actually /ipns/QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6.

The address: /ipns/QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6 and the address /ipfs/QmbtNuavtRJs9BijJo7uMrRSp926F92DKMQHAjQDajMuw1 are part of different systems in IPFS. Sort of like http://foo.bar and ftp://baz.bop different protocols. The addresses look the same though.

Are all hash values created as part of ‘ipfs add’ for the given peer identity returned ?

Could you clarify this question for me? I’m not sure I’m answering it correctly.

best guess:

ipfs add is typically how you add files to the network, but there are methods to access ipfs’s plumbing more directly, so not all the files on the network will be done through ipfs add. Also, your peer identity doesn’t have an effect on the addresses of the files. If you and I both have the same file, and we both run ipfs add theFileYouAndIHave.jpg, the address will be the same for that file.

edit: OH wait. Sorry I misunderstood you. The formatting in your post suggested a different question than I expected.

From @aronayne on Fri Aug 26 2016 22:37:19 GMT+0000 (UTC)

@Ghoughpteighbteau Invoking : ‘ipfs name resolve QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6’ a single value is returned :

/ipfs/QmbtNuavtRJs9BijJo7uMrRSp926F92DKMQHAjQDajMuw1

Is one hash value returned as there is one entry for the peer QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6 and so if ‘ipfs add’ is executed n times for peer id QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6 then 'ipfs name resolve QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6 ’ returns n entries ?

From @jbenet on Sat Aug 27 2016 01:44:11 GMT+0000 (UTC)

No. You need to publish:

ipfs name publish
On Fri, Aug 26, 2016 at 18:37 adrian-git-hub-user notifications@github.com
wrote:

@Ghoughpteighbteau https://github.com/Ghoughpteighbteau when invoke :
‘ipfs name resolve QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6’ a single
value is returned :

/ipfs/QmbtNuavtRJs9BijJo7uMrRSp926F92DKMQHAjQDajMuw1

Is one hash value returned as there is one entry for the peer
QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6 and so if ‘ipfs add’ is
executed n times for peer id QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6
then 'ipfs name resolve QmeWdgoZezpdHz1PX8Ly8AeDQahFkBNtHn6qKeNtWP1jB6 ’
returns n entries ?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/ipfs/faq/issues/166#issuecomment-242868415, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAIcofZKr5UlcnzigKEkadGXT0CRKdzFks5qj2qfgaJpZM4JthbB
.

From @Ghoughpteighbteau on Sat Aug 27 2016 02:20:30 GMT+0000 (UTC)

@adrian-git-hub-user Ahh. I see what you’re asking.

ipfs name resolve will only ever return one address, what’s important is that it can change.

Confused about why it’s important that it changes and why it doesn’t show you all of a persons files? I do not blame you, if you’re just learning about IPFS, IPNS is the worst place to start!

IPNS is a subcomponent of IPFS that lets you make dynamic content. If you want to make a decentralized version of Reddit on IPFS, you need IPNS to do it. But if you want to disseminate files or webpages in a totally decentralized fashion, IPNS doesn’t even get involved!