-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Runtime Support: Electron & Muon #843
Comments
I believe that the short term solution is making libp2p recipe's pluggable on node boot so that libp2p-webrtc-star can be added if the user wants. Then I can break libp2p-webrtc-star into libp2p-webrtc-star-browser and libp2p-webrtc-star-nodejs, having the nodejs one installed a posteriori by the users if the user wants. |
What would others say it is the best approach here:
Initially, I was more thinking of a), but to avoid code duplication and double publishing to npm, I'm not more inclined to b). The end result is the same if you are running js-ipfs in Node.js, it doesn't bring webrtc-star out of the box, however, if you:
You get WebRTC in Node.js again. This would take out all of the compilation issues with electron and enable users to use IPFS with the other transports. |
except for wrtc, libp2p-webrtc-star doesn't seam to have any logic specific to any environment, so I suggest using DI, with detailed instructions specific for electron on js-ipfs.. |
Ok, the first 🐉, I'm still seeing issues with other native dependencies. #884 adds an electron example so that it is quick to test. Any experienced electron devs out there that could check it as well? @kenshyx, @josselinchevalay, @kyledrake, @negamaxi et all :) |
Hello, I just tested it in renderer process. Unfortunately it doesn't work because I need to install it with
|
Are you using latest js-ipfs master? node-webcrypto-ossl is just used in Node.js, in the Browser it uses WebCrypto directly. Investigating.. |
Yes, I used latest js-ipfs from master. I forgot to specify that error |
Hi there. Just cloned this repo, main
|
Just finished migrating off one of the offenders to make this happen (node-webcrypto-ossl). Now, the new one is:
this one comes from libp2p-webrtc-star use of socket.io. We can move away from socket.io |
Is this still an issue? I've haven't been able to reproduce any of the issues linked here. I've so far been successful in running IPFS in the main and renderer processes. I'll be concentrating on - ipfs/aegir#157. |
Node.js 7.9.0, Chromium 58.0.3029.110, and Electron 1.7.6. |
@negamaxi I was able to reproduce the error with electron version - 1.7.6. The issues is not specifically related to the version of electron, but the version that the native modules are built with - electron 1.7.6 is using a different node version (7.9.0 in this case) that the one the modules are being installed with - |
Building with npm by executing the bellow script works for me:
Could you try it out and let me know if it works for you as well? Building with |
@dryajov confirmed, it works. |
* docs: add FAQ about Electron ref: #843 (comment) * Update README.md * Update README.md
You could use a postinstall script like:
copy from @dryajov 's example and change the electron version. |
I was building an Electron / IPFS app and it had a devil of a time with Windows builds because of UWS. The UWS author appears disinclined to support Electron, and but it can be made to work by fixing how the binding.gyp links SSL libraries. Simply put you need to add The previous problem noted above (missing |
If you are using const DaemonFactory = require('ipfsd-ctl');
const ipfsDaemon = DaemonFactory.create({ type: 'proc', exec: require('ipfs') }); Instead of Since we have built native modules to match nodejs version inside the electron, and |
There is now full support with the last dragon slayed by @leo6104! \o/ |
More and more user's have been having trouble using js-ipfs with Electron due to the native module dependencies, see:
The solution found passes by following this example: https://github.com/electron/electron/blob/master/docs/tutorial/using-native-node-modules.md
We should include instructions to guide users to follow that and also run tests in Electron's Node.js Process + Browser process just to be sure #697
Update: I've started tackling this issue, follow the rest of the thread to check the state of things. tl;dr; You should be able to run js-ipfs in the browser process of Electron just fine if you webpack/browserify js-ipfs, running in the main process (aka Node.js) is stil a ❓ due to native dependencies.
The text was updated successfully, but these errors were encountered: