Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Peer URI Hint Experiment #722

Open
lidel opened this issue May 19, 2019 · 4 comments
Open

Add Peer URI Hint Experiment #722

lidel opened this issue May 19, 2019 · 4 comments
Labels
good first issue Good issue for new contributors help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now

Comments

@lidel
Copy link
Member

lidel commented May 19, 2019

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.

@lidel lidel added kind/enhancement A net-new feature or improvement to an existing feature help wanted Seeking public contribution on this issue good first issue Good issue for new contributors P4 - Very Low labels May 19, 2019
@heypran
Copy link

heypran commented Jun 1, 2019

I would be interested in taking this up...if you can guide me a bit about it... point me to the right file...

@lidel
Copy link
Member Author

lidel commented Jun 2, 2019

@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 :)

Step 0: set up dev

We have some developer notes in /docs/developer-notes.md, but in short:

  1. building: npm run dev-build it will take care of everything (fetching dependencies, building)
  2. testing: run npm run firefox to start browser with extension loaded in it

Step 1: wire up hint detection

Core 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 :)

Step 2: add it as experiment in Preferences

This can be added later, when we are happy with step 1, making it ready for shipping:

  1. Add new boolean option in options.js#L12 (eg. peerUriHints)
  2. Add UI for enabling/disabling the experiment to experiments-form.js, you can use linkify as an example.
  3. Add i18n labels to _locales/en/messages.json (just `english, other ones are handled by Transifex)
  4. make hint detection enabled only when peerUriHints: true
  5. decide if this experiment should be enabled by default
  6. Bikeshed the final hint name. When we ship this, people will start using it to speed up content discovery. I proposed provs (we already have ipfs dht findprovs) but we should really get a consensus on the name before we ship it :)

@heypran
Copy link

heypran commented Jun 2, 2019

Thank You!

I will go through the above steps ... If I get stuck somewhere I might bug you again.

@lidel
Copy link
Member Author

lidel commented Jan 19, 2021

For the record, I think #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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good issue for new contributors help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now
Projects
None yet
Development

No branches or pull requests

3 participants