+ linux binaries
* use paths based on OS * minimal install
This commit is contained in:
BIN
bin/linux/geth
Normal file
BIN
bin/linux/geth
Normal file
Binary file not shown.
@@ -3,6 +3,8 @@ ECHO Clean the cache first
|
||||
call npm cache clean --force
|
||||
ECHO Prune the project for production
|
||||
call npm prune --production
|
||||
ECHO delete node modules
|
||||
rmdir node_modules /S /Q
|
||||
ECHO Install all dependencies
|
||||
call npm install
|
||||
ECHO Make a distribution
|
||||
|
||||
@@ -3,6 +3,8 @@ const {app, dialog} = require('electron');
|
||||
const appRoot = require('app-root-path');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
|
||||
|
||||
class Geth {
|
||||
constructor() {
|
||||
@@ -14,6 +16,22 @@ class Geth {
|
||||
} else {
|
||||
this.rootPath = appRoot.path;
|
||||
}
|
||||
|
||||
switch(os.type()) {
|
||||
case "Linux":
|
||||
this.binaries = path.join(this.rootPath, 'bin', 'linux');
|
||||
break;
|
||||
case "Darwin":
|
||||
this.binaries = path.join(this.rootPath, 'bin', 'macos');
|
||||
break;
|
||||
case "Windows_NT":
|
||||
this.binaries = path.join(this.rootPath, 'bin', 'win');
|
||||
break;
|
||||
default:
|
||||
this.binaries = path.join(this.rootPath, 'bin', 'win');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
_writeLog(text) {
|
||||
@@ -23,7 +41,7 @@ class Geth {
|
||||
startGeth() {
|
||||
// get the path of get and execute the child process
|
||||
try {
|
||||
const gethPath = path.join(path.join(this.rootPath, 'bin'), 'geth');
|
||||
const gethPath = path.join(this.binaries, 'geth');
|
||||
this.gethProcess = child_process.spawn(gethPath, ['--ws', '--wsorigins', '*', '--wsaddr', '127.0.0.1', '--wsport', '8546', '--wsapi', 'admin,db,eth,net,miner,personal,web3']);
|
||||
this.gethProcess.on('error', function(err) {
|
||||
dialog.showErrorBox("Error starting application", "Geth failed to start!");
|
||||
@@ -42,8 +60,12 @@ class Geth {
|
||||
}
|
||||
|
||||
stopGeth() {
|
||||
const gethWrapePath = path.join(path.join(this.rootPath, 'bin'), 'WrapGeth.exe');
|
||||
if (os.type() == "Windows_NT") {
|
||||
const gethWrapePath = path.join(this.binaries, 'WrapGeth.exe');
|
||||
child_process.spawnSync(gethWrapePath, [this.gethProcess.pid]);
|
||||
} else {
|
||||
this.gethProcess.kill('SIGTERM');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
13
package.json
13
package.json
@@ -1,11 +1,10 @@
|
||||
{
|
||||
"name": "Ether1Wallet",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"description": "Desktop wallet for Ether1 currency",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"start": "electron .",
|
||||
"postinstall": "electron-builder",
|
||||
"pack": "build --dir",
|
||||
"dist": "build"
|
||||
},
|
||||
@@ -14,8 +13,16 @@
|
||||
"win": {
|
||||
"icon": "build/icon.png",
|
||||
"target": "7z",
|
||||
"files": [
|
||||
"modules/*",
|
||||
"assets/**/*",
|
||||
"renderer/*",
|
||||
"package.json",
|
||||
"main.js",
|
||||
"index.html"
|
||||
],
|
||||
"extraResources": [
|
||||
"bin/*"
|
||||
"bin/win/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user