Can't access published IPNS record, config problem?

First, a little bit of background so y’all know where I’m coming from…

I started a project a couple months back. The goal was to make a completely decentralized publishing / subscription platform that could replace YouTube and social media platforms in general. In other words, it enables the publication of arbitrary content and subscription to the publishers in a censorship resistant way…

The original architecture is as follows: Use a DHT to serve in response to a requests for a particular public key, a magnet link which points to a JSON file containing profile information, including other magnet links which represent a users publications. This magnet link would be downloaded using webtorrent and the JSON would be passed into a UI(electron+angular) to be rendered appropriately. As a “feed”.

The key here is the DHT responds to a request for a persistent identity(pubkey) with data that is mutable/updatable(only by the holder of the corresponding private key).

I played around with a couple DHT libraries but after experimenting with IFPS/IPNS a bit I decided to make the switch. Now, instead of the DHT responding with a magnet link, I’m using IPNS to respond with an IPFS link which points to the aforementioned, latest json file.

To be clear, the goal of this is NOT for profiles/content to be accessible via a regular browser / http/s. Rather, to have electron acquire them directly through ipfs, which would already work if IPNS was more reliable / i could figure out how to configure it properly.

the abstract flow goes something like this…
IPNS / dht.GET(pubkey) -> ipfs / magnet link -> profile.json(list of ipfs /magnet link(s) to users publications) -> magnet/ipfs link -> content -> render in electron(already working, albeit very beta)…

Development has been going well, but I just can’t seem to reliably get IPNS to serve the IPFS links to the identity file. I’ve tried customizing the ipfs config but to no avail…

for reference: https://www.github.com/iohzrd/follow

Please let me know if you’d like further clarification or if you have any suggestions or thoughts…

Probably would make debugging easier if you could post links to source code responsible for performing these operations. That being said, IPNS can be pretty slow at the moment, but there’s a few things you can do to enable better performance, and discovery of records.

For better record publishing discovery, you can using the daemon flag --enable-namesys-pubsub however for this to properly work, other nodes will need to subscribe to the same topics of your records.

Additionally one thing to keep in mind with the availability of your records, is that they have lifetimes associated with them. Normally if the daemon or service being used to publish the reccord is always online, this isn’t a problem. However, if the node or service that was responsible for publishing the records does actually go offline, then the record won’t be republished and can dissapear from the network. A way to mitigate this is to tweak your lifetimes, and optionally your ttl.


I’m not running IPFS as a daemon, rather programmatically via node/electron. Any idea what the config equivalent of that flag would be? Also, I’m aware of the record lifespan. That’s an issue I plan to address once i get there.

I don’t think there is a config equivalent of that flag, however when initializing your IPFS via the require statement, I believe you can pass in options like so.

When you say I just can't seem to reliably get IPNS to serve the IPFS links to the identity file what are the specific issues you’re experiencing?

Sorry for the ambiguity. I think my usage of the term publish and subscribe might be getting confused with the pubsub system, which I am not using, and don’t believe i need to. I’m simply saying that I can’t retrieve IPNS records(that i published, from another computer) , like at all. but i’ll give it a shot anyway.

No problem, namesys pubsub is just a method of assisting the distribution and discovery of IPNS records, so it can potentially help alleviate being unable to discover IPNS records if configured correctly.

The two computers you’re using, the one publishing the record and the one are they on the same network, or different networks? Additionally, depending on the setup of your IPFS nodes they could be either running into issues with firewalls, or NAT and thus unable to either properly talk to other nodes, interact with the DHT, etc…

The two computers I’ve been testing with so far are both on the same local network, though i have a couple friends who will be helping me test soon. Testing the suggestion now…

Same result so far, with ipnsPubsub enabled or disabled, I get the following error when trying to retrieve the content associated this identity: QmcqwzjrpjRwrGFvUHptSpXTST3aWRrAyxohAfHfScQ172

the identity after the /ipns/ prefix seems like it’s being interpreted/formetted incorrectly. Maybe an error in ipfs itself?

the file it is supposed to be pointing to is accessable:
https://gateway.ipfs.io/ipfs/QmfPftrMH1EFSKQqjLoD8bKHCYhXxLLExCfn65PwHCtukZ

I know the way I’m doing it should work because I have a test file that works great, but only when resolving the ipns link of itself.

ipfs.on('ready', () => {
  ipfs.id((err, id) => {
    if (err) {
      return console.log(err)
    }
    console.log('ipfs.on ready')
    console.log(id.id)
    ipfs.name.resolve(id.id, function (err, name) {
      if (err) { throw err }
      console.log('resolve')
      console.log(name)
      ipfs.get(name.path, function (err, files) {
        console.log('get')
        if (err) { throw err }
        files.forEach((file) => {
          console.log(file)
          console.log(file.path)
          console.log(file.content.toString('utf8'))
        })
      })
    })
  })
})

I have the same problem. Have you found the solution?

No, I still cant access ANY IPNS records outside of from the node that published them… really wish I could figure out how… Default config or otherwise.