I need a mutable file with the same address on all peers without using DNS

I have just started using IPFS. I have an application that will be distributed as multiple peers. The application has an asset (say XYZ) that multiple files will attach to. Each peer may attach a file to XYZ. Each peer needs to be able to retrieve a list of all the attachments on XYZ.

I was hoping to store a JSON file called XYZ.json that any peer could open and modify without requiring DNS records to be updated. Can I use IPNS to store the file with a common name? I need it so that any peer can access the latest version of XYZ.json. Is this possible, and if so, is there a tutorial somewhere to show me how it is done?


hi ,

i’m not sure to do that you need IPNS


So, you could use IPNS but all your users will need to share a common key. Personally, I’d recommend having a separate key per user and have all users track each other’s XYZ.json file. That is:

  "Peers": [ QmPeer1, QmPeer2, ...],
  "Files": [QmFile1, QmFile2, ...],

When fetching the latest version, the user would:

  1. Lookup each peer’s version of the file.
  2. Merge them.
  3. Publish the merged version under their own IPNS key.

To get added to the group, at least one peer would need to acknowledge you by adding your peer ID to the Peers array.

Thanks @stebalien. Is the purpose of your approach to build up a sort of private network? It is an interesting approach. In this case there will be 1000s of assets and so the peer lookup file would become too large. It is a good idea though.

Basically, I’m trying to handle two problems:

  1. Conflicting updates made at the same time.
  2. Intentional tempering.

There are probably better ways to do this with something more flexible than IPNS but this is the only IPNS-only solution I can think of.