feat: leverage IPFS node provided by Brave #956
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for IPFS node provided by Brave Nightly (brave/brave-browser#10220) and closes #947
Important!
ipfs/ipfs-docs#581 needs merging once this work is completed so docs are up to date.
TLDR
chrome.ipfsAPIs and adds "Provided by Brave" node type in Preferencesipfs://yetOnboarding flow (IPFS already enabled in Brave)
When Companion is installed, user is presented with Welcome screen that has "Brave user" section at the very top:
Clicking on "Open Preferences" lets user to choose backend. In brave, "Provided by Brave" is added to the list:
Onboarding flow (IPFS not enabled yet)
The very first time (on an empty profile) is the same as before, but when "Provided by Brave" is selected Companion checks if Brave user selected how to resolve IPFS resources.
If they did not make the choice yet (resolve method being
ask) we openipfs://URI in a new tab to trigger the decision via dropbar UI:Companion needs user to click "Enable IPFS" – it will download go-ipfs binary and set local node as the default resolver of
ipfs://andipns://URIs.For now, the triggers is just an image, but a dedicated HTML page with some text asking user to click "Enable IPFS" would be better, as downloading go-ipfs binary may take time and user won't see any visual feedback for a while.
Given available APIs, our extension is able to update the tab to indicate a different activation stage and provide some visual feedback:
ipfs initipfs daemonto start@jessicaschilling I think a simple static page(s) similar to #911 would do – are you able to come up with user-friendly text/prompt for the activation steps? First one is the most important, remaining ones are just progress updates.