text
ipfs://{cid}?provs={multiaddr1},{peerId2},{peerId3}`
http://127.0.0.1:8080/ipfs/{cid}?provs={multiaddr1},{peerId2},{peerId3}
The idea is to detect above hints and connect to listed peers to improve content discovery speed if possible. Due to potential privacy considerations, this should start as opt-in experiment.
Ref.
I would be interested in taking this up...if you can guide me a bit about it... point me to the right file...
@heychessy thank you! I wrote some notes to get you oriented, let me know if you have any questions or something is confusing, will be happy to help and explain :)
We have some developer notes in /docs/developer-notes.md, but in short:
npm run dev-build it will take care of everything (fetching dependencies, building)npm run firefox to start browser with extension loaded in itCore logic responsible for handling HTTP requests is in src/lib/ipfs-request.js.
I believe you add hint detection inside of existing onBeforeRequest listener. Basically you would check if URL of processed request includes provs parameter, and if so, make asynchronous ipfs.swarm.connect calls to all peers listed in its value.
This should be enough for you to open a PR and iterate there :)
This can be added later, when we are happy with step 1, making it ready for shipping:
peerUriHints)linkify as an example.peerUriHints: trueprovs (we already have ipfs dht findprovs) but we should really get a consensus on the name before we ship it :)Thank You!
I will go through the above steps ... If I get stuck somewhere I might bug you again.
For the record, I think https://github.com/ipfs-shipyard/ipfs-companion/issues/925 is a safer approach and should be prioritized instead.
(unlike this, does not hardcode peersids/addrs in the shared link, enables scaling/delegation without user's involvement)