There is no need to check wether an lnd process exists and prevent
Zap from starting if so. We don't care if there is another process
running. We only care that we can successfully start up our own process.
If there is a conflict with another lnd process such as a port that we
need already being in use we already handle this elsewhere in our code.
The standard approach on Darwin is to keen applications running when the
window is closed. Clicking the apps icon again in the doc should bring
back the application window.
This changeset refactors things to handle this. It will keep Zap and lnd
running in the background when the main application window is closed.
Quitting the app will stop both the app and lnd.
Fix#586Fix#601
Add a script that fetches specific lnd binaries for each supported
platform/arch into the resources directory and update package scripts
to build for multiple architectures.
Use `lnd-binary` to download and install the correct mac/windows/linux
lnd binary as part of the install process.
See https://github.com/mrfelton/lnd-binary
Windows build is failing on this line with:
> node --trace-warnings -r babel-register ./node_modules/.bin/webpack-serve --config webpack.config.renderer.dev.js
C:\Users\user\Documents\zap-desktop\node_modules\.bin\webpack-serve:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Module._extensions..js (module.js:663:10)
at Object.require.extensions.(anonymous function) [as .js] (C:\Users\user\Documents\zap-desktop\node_modules\babel-register\lib\node.js:152:7)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
This is because webpack-serve expects a js file, but on windows, which
lacks supports for shebang comments, they are wrapped in .cmd files to
be executable. e.g. see:
https://github.com/gotwarlost/istanbul#usage-on-windows
To fix this, we reference the js file directly to avoid the .cmd
wrapping.
Fetch the current block height from multiple block explorers early on in
the sync process. This ensures that we get the correct block height in
the case where our BTCd node is still mid way through syncing. Do this
in the main process rather than in the render process.
Define an npm config variable in package.json to specify where the
stylesheets are that we want to lint and update our package scripts to
reference this.
It looks like we were a little hasty in #492 as rimraf is used directly
within package.json in the `flow-typed` script and so it needs to remain
as a dev dependency.
See https://github.com/LN-Zap/zap-desktop/pull/492
Concurrently v3.6.0 includes a number of improvements and fixes. Of
particular interest is the new npm command shortcut feature which we can
use to shorten our package scripts a little more.
See https://github.com/kimmobrunfeldt/concurrently/releases/tag/3.6.0