IPNS publishing after generating a key

Wow, I tested it via HTTP APIs you linked and it seems to… work just fine. :rocket:

Not sure why you had different IPNS hash, but I got the feeling you were regenerating key instead of generating it only once and copying it to all nodes that should be able to publish with it.

I wrote a short instruction, check if you were following the same steps:

Publishing with the same key from two different nodes

I generated a new key under alias “test”:

nodeA $ curl 'http://localhost:5001/api/v0/key/gen?arg=test&type=ed25519'
{"Name":"test","Id":"QmbSSmC6ftFTz86twGypbfdRgq3apoixQQ2MgEdZmzNiMf"}

Then I published a picture /ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR in IPNS under PeerID of that key:

nodeA $ curl 'http://localhost:5001/api/v0/name/publish?arg=/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR&key=test'
{"Name":"QmbSSmC6ftFTz86twGypbfdRgq3apoixQQ2MgEdZmzNiMf","Value":"/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"}

I tested it and when I opened IPNS location for generated key:

/ipns/QmbSSmC6ftFTz86twGypbfdRgq3apoixQQ2MgEdZmzNiMf

I could see content from /ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR

Now, the important part: I wanted to publish to the same IPNS address from a different node.

I copied $IPFS_PATH/keystore/test to the same location at a different machine and used it to publish different picture with it:

nodeB $ curl 'http://localhost:5001/api/v0/name/publish?arg=/ipfs/QmYHNYAaYK5hm3ZhZFx5W9H6xydKDGimjdgJMrMSdnctEm&key=test'
{"Name":"QmbSSmC6ftFTz86twGypbfdRgq3apoixQQ2MgEdZmzNiMf","Value":"/ipfs/QmYHNYAaYK5hm3ZhZFx5W9H6xydKDGimjdgJMrMSdnctEm"}

Then, I opened the same IPNS location (for copied key):

/ipns/QmbSSmC6ftFTz86twGypbfdRgq3apoixQQ2MgEdZmzNiMf

I could see updated picture from /ipfs/QmYHNYAaYK5hm3ZhZFx5W9H6xydKDGimjdgJMrMSdnctEm

2 Likes