Skip to content

Conversation

@tabcat
Copy link
Contributor

@tabcat tabcat commented Nov 19, 2025

Title

feat: ipns libp2p fetch

Description

Adds @libp2p/fetch functionality to the pubsub router of helia/ipns.
The pubsub router will libp2p/fetch the latest local record from new pubsub peers if libp2p.services.fetch is found.

Closes #893

Notes & open questions

Should get method of the pubsub router wait for a few peers to be queries with fetch, or should the router emit an event when it finds a newer record?

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

@tabcat
Copy link
Contributor Author

tabcat commented Nov 19, 2025

Does a lookup function need to be registered with @libp2p/fetch? It seems like it would be needed, but the resources I'm looking at don't use it.

@tabcat
Copy link
Contributor Author

tabcat commented Nov 21, 2025

I'm considering checking the current subscribers for the topic directly before the fetch call. The check would see if we are still pubsub peered with the peerId that is being queried with the fetch call. If not then cancel the fetch and return. This would reduce the possibility of opening a new connection instead of just a new stream.

@hsanjuan
Copy link

Triage:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IPNS should use libp2p-fetch to retrieve IPNS records from peers

2 participants