-
Notifications
You must be signed in to change notification settings - Fork 331
Closed
Labels
P0Critical: Tackled by core team ASAPCritical: Tackled by core team ASAParea/braveIssues related to Brave BrowserIssues related to Brave Browsereffort/daysEstimated to take multiple days, but less than a weekEstimated to take multiple days, but less than a weekexp/wizardExtensive knowledge (implications, ramifications) requiredExtensive knowledge (implications, ramifications) required
Description
This supersedes embedded js-ipfs (#716)
Brave Nightly will ship embedded go-ipfs soon and will expose some API endpoints for ipfs-companion to facilitate end-to-end integration. Custom WebExtension APIs will enable ipfs-companion to:
- read user preference on how to load IPFS resources (public gw, local gw, embedded one, disabled)
- read
$IPFS_PATH/configof embedded go-ipfs node managed by Brave - start/stop the node
We should at the very minimum:
- add embedded go-ipfs to the list, if user enabled it in brave
- on initial run, use embedded node as a fallback
- detect when embedded go-ipfs running, and save it as the default instead of 5001/8080 one
- this should be fallback, we dont want to break Brave users who already use ipfs-companion+ipfs-desktop
TBD:
- start (and stop?) embedded node when user switches Node Type in Companion's Preferences
- hide/migrate embedded js-ipfs to embedded go-ipfs
Details
Excerpt from brave/brave-browser#10220:
// Checks if a feature flag is enabled
chrome.ipfs.getIPFSEnabled((enabled: boolean) => {})
// Obtains a string representation of the resolve method
// method is one of the following strings:
// "ask" uses a gateway but also prompts them to install a local node
// "gateway" uses a gateway but also prompts them to install a local node
// "local" uses a gateway but also prompts them to install a local node
// "disabled" uses a gateway but also prompts them to install a local node
// Throws an error if IPFS feature flag is not enabled
chrome.ipfs.getResolveMethodType((method: string) => {})
// Launches a daemon
// Throws an error if IPFS feature flag is not enabled
// Throws an error if a local node is not installed
chrome.ipfs.launch((success: boolean) => {})
// Shutsdown a daemon
// Throws an error if IPFS feature flag is not enabled
// Throws an error if a local node is not installed
chrome.ipfs.shutdown((success: boolean) => {})
// Obtains the config contents of the local IPFS node
// Throws an error if IPFS feature flag is not enabled
// Throws an error if a local node is not installed
chrome.ipfs.getConfig((success: boolean, config: string) => {})
// Checks if the local node is installed
chrome.ipfs.getExecutableAvailable((available: boolean) => {})
chrome.ipfs.* behavior in Brave Nightly @ v1.20.36
getIPFSEnabledis enabled by default in Nightly, but we should check it as a formalitygetResolveMethodTypeis the actual hint of user's preferenceaskis the default on an empty profilelocal– after "Enable IPFS" is clicked and go-ipfs daemon got installed
launch- the weird one. returns
falsebut also triggers install in the background, when claled later (after install is done) it starts node and returnstrue, but does not changeresolveMethodType(it is stillask)- filled chrome.ipfs: launch|shutdown should control getResolveMethodType brave/brave-browser#13237 to clarify if it is a feature or a bug
- the weird one. returns
shutdownalways returnstrue(even if node was already off)getExecutableAvailablegetreturns true after install
References
- Native IPFS support in Brave: Native IPFS support in Brave brave/brave-browser#10220
Metadata
Metadata
Assignees
Labels
P0Critical: Tackled by core team ASAPCritical: Tackled by core team ASAParea/braveIssues related to Brave BrowserIssues related to Brave Browsereffort/daysEstimated to take multiple days, but less than a weekEstimated to take multiple days, but less than a weekexp/wizardExtensive knowledge (implications, ramifications) requiredExtensive knowledge (implications, ramifications) required