Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
Removed IRI.cfg, upgraded to 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
domschiener committed Aug 29, 2016
1 parent 9cc98ab commit 4eaa553
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 46 deletions.
63 changes: 18 additions & 45 deletions app/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ var App = (function(App, undefined) {
if (!settings.hasOwnProperty("bounds") || typeof(settings.bounds) != "object") {
settings.bounds = {width: 520, height: 736};
}

if (settings.hasOwnProperty("javaArgs") && settings.javaArgs == "undefined") {
settings.javaArgs = "";
}
Expand Down Expand Up @@ -308,10 +308,10 @@ var App = (function(App, undefined) {
}

App.createWindow = function(onReady) {
var windowOptions = {"width" : settings.bounds.width,
var windowOptions = {"width" : settings.bounds.width,
"height" : settings.bounds.height,
"minWidth" : 305,
"minHeight" : 424,
"minWidth" : 305,
"minHeight" : 424,
"backgroundColor" : "#4DC1B5",
"center" : true,
"show" : false};
Expand Down Expand Up @@ -344,7 +344,7 @@ var App = (function(App, undefined) {
win.webContents.closeDevTools();
}
}

if (isClosed) {
return;
} else if (isClosing) {
Expand All @@ -362,7 +362,7 @@ var App = (function(App, undefined) {
App.killServer(function() {
isClosed = true;
electron.app.quit();
});
});
});

win.on("closed", function () {
Expand All @@ -382,7 +382,7 @@ var App = (function(App, undefined) {
win.webContents.once("did-finish-load", function() {
console.log("Set Window Title");

win.setTitle("IOTA Wallet " + String(appVersion).escapeHTML());
win.setTitle("IOTA Wallet " + String(appVersion).escapeHTML());

if (onReady) {
onReady();
Expand Down Expand Up @@ -677,8 +677,6 @@ var App = (function(App, undefined) {
console.log("Server directory is: " + serverDirectory);
console.log("Jar directory is: " + jarDirectory);

var defaultNodes = "+udp://188.138.57.93:14265\r\n+udp://104.238.171.31:14265\r\n+udp://46.101.118.240:14265\r\n+udp://178.62.203.156:14265\r\n+udp://139.59.134.213:14265\r\n+udp://104.238.181.100:14265\r\n+udp://66.11.119.73:14265\r\n+udp://167.114.182.68:14265\r\n+udp://104.198.4.96:14265\r\n+udp://46.101.147.184:14265\r\n+udp://107.170.52.140:14265\r\n+udp://104.198.15.213:14265";

if (fs.existsSync(serverDirectory)) {
var uiFolder = path.join(serverDirectory, "ui");
var srcFolder = path.join(serverDirectory, "src");
Expand All @@ -700,25 +698,9 @@ var App = (function(App, undefined) {
}
}

if (!settings.hasDefaultNodes) {
console.log("Append default nodes");
fs.appendFileSync(path.join(serverDirectory, "IRI.cfg"), "\r\n" + defaultNodes);
settings.hasDefaultNodes = 1;
}
} else {
console.log("Creating server directory.");
fs.mkdirSync(serverDirectory);

var defaultConfigPath = path.join(jarDirectory, "IRI.cfg");

if (fs.existsSync(defaultConfigPath)) {
console.log("Copying default IRI.cfg.");
var fsExtra = require("fs-extra");
fsExtra.copySync(defaultConfigPath, path.join(serverDirectory, "IRI.cfg"));
} else {
console.log("Creating default IRI.cfg.");
fs.writeFileSync(path.join(serverDirectory, "IRI.cfg"), defaultNodes);
}
}
} catch (err) {
console.log("err:");
Expand Down Expand Up @@ -928,7 +910,7 @@ var App = (function(App, undefined) {
}

var params = [];

try {
if (oneTimeJavaArgs) {
if (oneTimeJavaArgs != -1) {
Expand Down Expand Up @@ -984,7 +966,7 @@ var App = (function(App, undefined) {
App.logServerOutput(data);
App.checkServerOutput(data);

if (!isStarted && !didKillServer && !serverInitializationError) {
if (!isStarted && !didKillServer && !serverInitializationError) {
//&& data.match(/java\.lang\.ExceptionInInitializerError|java\.net\.BindException|java\.lang\.IllegalArgumentException/i)) {
serverInitializationError = true;

Expand Down Expand Up @@ -1041,7 +1023,7 @@ var App = (function(App, undefined) {
App.killServer = function(fn) {
if (server && server.exitCode == null) {
App.showKillAlert();
}
}

setTimeout(function() {
if (server && server.exitCode == null) {
Expand Down Expand Up @@ -1330,7 +1312,7 @@ var App = (function(App, undefined) {
if (server && server.pid) {
var pid = server.pid;

pusage.stat(pid, function(err, stat) {
pusage.stat(pid, function(err, stat) {
if (err) {
console.log("Error tracking CPU");
console.log(err);
Expand Down Expand Up @@ -1404,14 +1386,6 @@ var App = (function(App, undefined) {
if (!msg) {
msg = "A server initialization error occurred.";
}

var serverConfig = "";

if (serverDirectory) {
try {
var serverConfig = fs.readFileSync(path.join(serverDirectory, "IRI.cfg"), "utf8");
} catch (err) {}
}

if (!selectedJavaLocation) {
selectedJavaLocation = "java";
Expand Down Expand Up @@ -1445,16 +1419,15 @@ var App = (function(App, undefined) {
});

child.on("exit", function() {
App.showOtherWindow("init_error.html", title, msg, {"javaArgs" : args,
App.showOtherWindow("init_error.html", title, msg, {"javaArgs" : args,
"serverOutput" : serverOutput,
"serverConfig" : serverConfig,
"javaVersionOK" : javaVersionOK,
"java64BitsOK" : java64BitsOK,
"is64BitOS" : is64BitOS});
});
} else {
console.log("32-bit");
App.showOtherWindow("init_error.html", title, msg, {"javaArgs": args, "serverOutput": serverOutput, "serverConfig": serverConfig});
App.showOtherWindow("init_error.html", title, msg, {"javaArgs": args, "serverOutput": serverOutput});
}

selectedJavaLocation = "";
Expand Down Expand Up @@ -1516,17 +1489,17 @@ var App = (function(App, undefined) {
var height = 300;
}

otherWin = new electron.BrowserWindow({"width" : 600,
otherWin = new electron.BrowserWindow({"width" : 600,
"height" : height,
"show" : false,
"useContentSize" : true,
"center" : true,
"resizable" : false});

otherWin.loadURL("file://" + path.dirname(__dirname) + "/alerts/" + filename);

otherWin.setFullScreenable(false);

//otherWin.center();

otherWin.on("closed", function() {
Expand Down Expand Up @@ -1608,7 +1581,7 @@ var App = (function(App, undefined) {
} else {
var loginSettings = {"openAtLogin": false};
}

win.webContents.send("showPreferences", {"javaArgs": settings.javaArgs, "openAtLogin": loginSettings.openAtLogin});
}
}
Expand Down Expand Up @@ -1906,4 +1879,4 @@ electron.ipcMain.on("showServerLog", App.showServerLog);

electron.ipcMain.on("showModal", function(event, identifier, html) {
App.showModal(identifier, html);
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "iota",
"productName": "IOTA Wallet",
"description": "IOTA Wallet",
"version": "1.0.3",
"version": "1.0.4",
"main": "app/js/main.js",
"scripts": {
"prepublish": "cd app && bower install && cd ../ui && bower install",
Expand Down

0 comments on commit 4eaa553

Please sign in to comment.