+ 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
|
call npm cache clean --force
|
||||||
ECHO Prune the project for production
|
ECHO Prune the project for production
|
||||||
call npm prune --production
|
call npm prune --production
|
||||||
|
ECHO delete node modules
|
||||||
|
rmdir node_modules /S /Q
|
||||||
ECHO Install all dependencies
|
ECHO Install all dependencies
|
||||||
call npm install
|
call npm install
|
||||||
ECHO Make a distribution
|
ECHO Make a distribution
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ const {app, dialog} = require('electron');
|
|||||||
const appRoot = require('app-root-path');
|
const appRoot = require('app-root-path');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
const os = require('os');
|
||||||
|
|
||||||
|
|
||||||
class Geth {
|
class Geth {
|
||||||
constructor() {
|
constructor() {
|
||||||
@@ -14,6 +16,22 @@ class Geth {
|
|||||||
} else {
|
} else {
|
||||||
this.rootPath = appRoot.path;
|
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) {
|
_writeLog(text) {
|
||||||
@@ -23,7 +41,7 @@ class Geth {
|
|||||||
startGeth() {
|
startGeth() {
|
||||||
// get the path of get and execute the child process
|
// get the path of get and execute the child process
|
||||||
try {
|
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 = 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) {
|
this.gethProcess.on('error', function(err) {
|
||||||
dialog.showErrorBox("Error starting application", "Geth failed to start!");
|
dialog.showErrorBox("Error starting application", "Geth failed to start!");
|
||||||
@@ -42,8 +60,12 @@ class Geth {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stopGeth() {
|
stopGeth() {
|
||||||
const gethWrapePath = path.join(path.join(this.rootPath, 'bin'), 'WrapGeth.exe');
|
if (os.type() == "Windows_NT") {
|
||||||
child_process.spawnSync(gethWrapePath, [this.gethProcess.pid]);
|
const gethWrapePath = path.join(this.binaries, 'WrapGeth.exe');
|
||||||
|
child_process.spawnSync(gethWrapePath, [this.gethProcess.pid]);
|
||||||
|
} else {
|
||||||
|
this.gethProcess.kill('SIGTERM');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
15
package.json
15
package.json
@@ -1,11 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "Ether1Wallet",
|
"name": "Ether1Wallet",
|
||||||
"version": "0.1.2",
|
"version": "0.1.3",
|
||||||
"description": "Desktop wallet for Ether1 currency",
|
"description": "Desktop wallet for Ether1 currency",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "electron .",
|
"start": "electron .",
|
||||||
"postinstall": "electron-builder",
|
|
||||||
"pack": "build --dir",
|
"pack": "build --dir",
|
||||||
"dist": "build"
|
"dist": "build"
|
||||||
},
|
},
|
||||||
@@ -14,9 +13,17 @@
|
|||||||
"win": {
|
"win": {
|
||||||
"icon": "build/icon.png",
|
"icon": "build/icon.png",
|
||||||
"target": "7z",
|
"target": "7z",
|
||||||
|
"files": [
|
||||||
|
"modules/*",
|
||||||
|
"assets/**/*",
|
||||||
|
"renderer/*",
|
||||||
|
"package.json",
|
||||||
|
"main.js",
|
||||||
|
"index.html"
|
||||||
|
],
|
||||||
"extraResources": [
|
"extraResources": [
|
||||||
"bin/*"
|
"bin/win/*"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"repository": "https://github.com/taeguscromis/Ether1DesktopWallet",
|
"repository": "https://github.com/taeguscromis/Ether1DesktopWallet",
|
||||||
|
|||||||
Reference in New Issue
Block a user