diff --git a/app/browser/ipfs.js b/app/browser/ipfs.js deleted file mode 100644 index d229b72e56f..00000000000 --- a/app/browser/ipfs.js +++ /dev/null @@ -1,77 +0,0 @@ -/* IPFS node in electron's main process */ - -// TODO(diasdavid) - review electron's main process support https://github.com/ipfs/js-ipfs/issues/843 - -// const electron = require('electron') -// const ipc = electron.ipcMain -// const messages = require('../../js/constants/messages') -// const IPFS = require('ipfs') -// const os = require('os') -// const path = require('path') - -module.exports = {init} - -// Set to see communication between WebTorrent and torrent viewer tabs -const DEBUG_IPC = false -if (DEBUG_IPC) { - console.log('IPFS IPC debugging enabled') -} - -// IPFS node -// let node = null -// let channels = {} - -// Receive messages via the window process, ultimately from the UI in a process -function init (state, action) { - if (DEBUG_IPC) { - console.log('IPFS IPC init') - } - - return state - - /* - node = new IPFS({ - repo: path.join(os.homedir(), '/.brave-jsipfs') - }) - - node.on('ready', () => { - if (DEBUG_IPC) { - console.log('IPFS node is ready') - } - }) - - node.on('error', (err) => console.log('IPFS: ', err)) - - // access on the browser with remote.getGlobal('ipfs') - global.ipfs = node - */ - - /* TODO(diasdavid) consider enabling the browser tab to start and stop the node - ipc.on(messages.IPFS_MESSAGE, function (event, msg) { - if (DEBUG_IPC) { - console.log('IPFS: Received IPC: ' + JSON.stringify(msg)) - } - - channels[msg.clientKey] = e.sender - server.receive(msg) - }) - */ -} - -// Send messages from the browser process (here), thru the window process, to the -/* -function send (msg) { - if (DEBUG_IPC) console.log('Sending IPC: ' + JSON.stringify(msg)) - const channel = channels[msg.clientKey] - if (!channel) { - if (DEBUG_IPC) console.error('Ignoring unrecognized clientKey ' + msg.clientKey) - return - } - if (channel.isDestroyed()) { - if (DEBUG_IPC) console.log('Removing destroyed channel, clientKey ' + msg.clientKey) - delete channels[msg.clientKey] - return - } - channel.send(messages.IPFS_MESSAGE, msg) -} -*/ diff --git a/js/constants/messages.js b/js/constants/messages.js index aa5401ff1a1..b5eb7321de5 100644 --- a/js/constants/messages.js +++ b/js/constants/messages.js @@ -147,9 +147,7 @@ const messages = { // PDFJS LOAD_URL_REQUESTED: _, // Torrent - TORRENT_MESSAGE: _, - // IPFS - IPFS_MESSAGE: _ + TORRENT_MESSAGE: _ // DO NOT ADD TO THIS LIST - see above } diff --git a/js/stores/appStore.js b/js/stores/appStore.js index 7a8cb9ca74b..b6a69424cd4 100644 --- a/js/stores/appStore.js +++ b/js/stores/appStore.js @@ -32,7 +32,6 @@ const nativeImage = require('../../app/nativeImage') const filtering = require('../../app/filtering') const basicAuth = require('../../app/browser/basicAuth') const webtorrent = require('../../app/browser/webtorrent') -const ipfs = require('../../app/browser/ipfs') const assert = require('assert') const profiles = require('../../app/browser/profiles') const {zoomLevel} = require('../../app/common/constants/toolbarUserInterfaceScale') @@ -428,8 +427,6 @@ const handleAppAction = (action) => { appState = filtering.init(appState, action, appStore) appState = basicAuth.init(appState, action, appStore) appState = webtorrent.init(appState, action, appStore) - // TODO(diasdavid) - init IPFS in the main process - appState = ipfs.init(appState, action, appStore) appState = profiles.init(appState, action, appStore) appState = require('../../app/browser/menu').init(appState, action, appStore) appState = require('../../app/sync').init(appState, action, appStore)