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

Commit cb13318

Browse files
author
domschiener
committed
fixed testnet, some other changes
1 parent a2c35c3 commit cb13318

File tree

4 files changed

+130
-30
lines changed

4 files changed

+130
-30
lines changed

app/js/main.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ var App = (function(App, undefined) {
6565
var iriVersion = "";
6666
var lastError = "";
6767

68-
var isTestNet = String(appVersion).match(/\-testnet$/) != null;
68+
var isTestNet = String(appVersion).match(/\-testnet$/) !== null;
6969

7070
App.uiIsReady = false;
7171
App.uiIsInitialized = false;
@@ -152,7 +152,7 @@ var App = (function(App, undefined) {
152152
settings.isFirstRun = 1;
153153
}
154154
if (!settings.hasOwnProperty("port")) {
155-
settings.port = (isTestNet ? 14999 : 14265);
155+
settings.port = (isTestNet ? 14900 : 14265);
156156
}
157157
if (!settings.hasOwnProperty("depth")) {
158158
settings.depth = 3;
@@ -171,14 +171,14 @@ var App = (function(App, undefined) {
171171
} catch (err) {
172172
console.log("Error reading settings:");
173173
console.log(err);
174-
settings = {bounds: {width: 520, height: 736}, checkForUpdates: 1, lastUpdateCheck: 0, showStatusBar: 0, isFirstRun: 1, port: (isTestNet ? 14999 : 14265), nodes: []};
174+
settings = {bounds: {width: 520, height: 736}, checkForUpdates: 1, lastUpdateCheck: 0, showStatusBar: 0, isFirstRun: 1, port: (isTestNet ? 14900 : 14265), nodes: []};
175175
}
176176

177177
try {
178178
if (electron.screen) {
179179
var displaySize = electron.screen.getPrimaryDisplay().workAreaSize;
180180

181-
if (displaySize.width < settings.bounds.width+100 || displaySize.height < settings.bounds.height+100) {
181+
if (displaySize.width < settings.bounds.width + 100 || displaySize.height < settings.bounds.height+100) {
182182
settings.bounds.height = displaySize.height - 100;
183183
settings.bounds.width = Math.round(settings.bounds.height / 16 * 11);
184184
}
@@ -625,15 +625,15 @@ var App = (function(App, undefined) {
625625
},
626626
{
627627
label: "Official Website",
628-
click() { shell.openExternal("https://iotatoken.com/"); }
628+
click() { shell.openExternal("https://iota.org/"); }
629629
},
630630
{
631631
label: "Forum",
632-
click() { shell.openExternal("https://forum.iotatoken.com/"); }
632+
click() { shell.openExternal("https://forum.iota.org/"); }
633633
},
634634
{
635635
label: "Chat",
636-
click() { shell.openExternal("https://slack.iotatoken.com/"); }
636+
click() { shell.openExternal("https://slack.iota.org/"); }
637637
},
638638
{
639639
label: "Documentation",
@@ -1004,6 +1004,11 @@ var App = (function(App, undefined) {
10041004
params.push("-e");
10051005
}
10061006

1007+
if (isTestNet) {
1008+
console.log("TESTNET VERSION")
1009+
params.push("--testnet");
1010+
}
1011+
10071012
params.push("-p");
10081013
params.push(settings.port);
10091014

@@ -1012,8 +1017,6 @@ var App = (function(App, undefined) {
10121017
params.push(settings.nodes.join(" "));
10131018
}
10141019

1015-
params.push("--headless");
1016-
10171020
console.log(params.join(" "));
10181021

10191022
serverOutput = [];
@@ -1334,13 +1337,16 @@ var App = (function(App, undefined) {
13341337
}
13351338
} else {
13361339
// This can result in errors.. Need to have a real response from the console instead of just this.
1337-
var iri = data.match(/Welcome to IRI (Testnet)?\s*([0-9\.]+)/i);
1338-
if (iri) {
1340+
var iri = data.indexOf("Welcome to IRI")
1341+
var iriVersion = data.match(/\d+/g).join([])
1342+
1343+
if (iri !== -1) {
1344+
1345+
var initTestnet = data.indexOf("Testnet");
13391346
//don't run mainnet IRI in testnet GUI, and other way around
1340-
if (isTestNet && !iri[1] || !isTestNet && iri[1]) {
1347+
if (isTestNet && !initTestnet || !isTestNet && initTestnet) {
13411348
App.quit();
13421349
}
1343-
iriVersion = iri[2];
13441350
}
13451351

13461352
if (data.match(/IOTA Node initialised correctly/i)) {
@@ -1684,7 +1690,7 @@ var App = (function(App, undefined) {
16841690
win.webContents.send("pasteTrytes");
16851691
}
16861692
}
1687-
1693+
16881694
App.claimProcess = function() {
16891695
if (App.windowIsReady()) {
16901696
App.showWindowIfNotVisible();
@@ -1829,8 +1835,6 @@ var App = (function(App, undefined) {
18291835
}
18301836
}
18311837

1832-
App.saveSettings();
1833-
18341838
if (relaunch || !App.windowIsReady()) {
18351839
App.relaunchApplication();
18361840
} else if (lightWalletHostChange) {

package-temp.json

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{
2+
"name": "iota",
3+
"productName": "IOTA Wallet",
4+
"description": "IOTA Wallet",
5+
"version": "2.2.1",
6+
"license": "GPL-3.0",
7+
"main": "app/js/main.js",
8+
"scripts": {
9+
"postinstall": "install-app-deps && cd app && bower install && cd ../ui && bower install",
10+
"start": "export NODE_ENV=development || set NODE_ENV=development && electron app/js/main.js",
11+
"precompile": "rimraf out/*",
12+
"compile": "export CSC_IDENTITY_AUTO_DISCOVERY=false && build --win --mac --linux --x64 --ia32",
13+
"compile:lin": "build --linux --x64 --ia32",
14+
"compile:mac": "export CSC_IDENTITY_AUTO_DISCOVERY=false && build --mac --x64",
15+
"compile:win": "build --win --x64 --ia32",
16+
"prepublish": "rimraf out/*",
17+
"publish": "export CSC_IDENTITY_AUTO_DISCOVERY=false && build --win --mac --linux --x64 --ia32 --publish always",
18+
"publish:lin": "build --linux --x64 --ia32 --publish always",
19+
"publish:mac": "export CSC_IDENTITY_AUTO_DISCOVERY=false && build --mac --x64 --publish always",
20+
"publish:win": "build --win --x64 --ia32 --publish always"
21+
},
22+
"author": "IOTA Foundation <contact@iota.org>",
23+
"homepage": "https://www.iota.org",
24+
"repository": {
25+
"type": "git",
26+
"url": "https://github.com/iotaledger/wallet"
27+
},
28+
"dependencies": {
29+
"ffi": "^2.2.0",
30+
"fs-extra": "^1.0.0",
31+
"glob": "^7.1.1",
32+
"pidusage": "^1.1.1"
33+
},
34+
"devDependencies": {
35+
"electron": "^1.4.14",
36+
"electron-builder": "^11.5.0",
37+
"rimraf": "^2.5.4"
38+
},
39+
"build": {
40+
"deleteDb": false,
41+
"directories": {
42+
"buildResources": "build",
43+
"output": "out"
44+
},
45+
"publish": [
46+
"github"
47+
],
48+
"appId": "com.iotatoken.wallet",
49+
"category": "public.app-category.developer-tools",
50+
"extraResources": [
51+
"iri/iri.jar",
52+
"ccurl/**/*",
53+
"ui/**/*"
54+
],
55+
"protocols": [
56+
{
57+
"name": "IOTA URL Scheme",
58+
"schemes": [
59+
"iota"
60+
]
61+
}
62+
],
63+
"dmg": {
64+
"iconSize": 125,
65+
"contents": [
66+
{
67+
"x": 235,
68+
"y": 290,
69+
"type": "link",
70+
"path": "/Applications"
71+
},
72+
{
73+
"x": 235,
74+
"y": 20,
75+
"type": "file"
76+
}
77+
]
78+
},
79+
"win": {
80+
"target": "nsis"
81+
},
82+
"linux": {
83+
"target": [
84+
"AppImage",
85+
"deb",
86+
"rpm",
87+
"tar.gz"
88+
],
89+
"packageUrl": "https://www.iota.org/"
90+
}
91+
}
92+
}

package.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "iota",
3-
"productName": "IOTA Wallet",
4-
"description": "IOTA Wallet",
5-
"version": "2.2.0",
2+
"name": "iota-testnet",
3+
"productName": "IOTA Wallet Testnet",
4+
"description": "IOTA Wallet Testnet",
5+
"version": "2.2.1-testnet",
66
"license": "GPL-3.0",
77
"main": "app/js/main.js",
88
"scripts": {
@@ -19,7 +19,7 @@
1919
"publish:mac": "export CSC_IDENTITY_AUTO_DISCOVERY=false && build --mac --x64 --publish always",
2020
"publish:win": "build --win --x64 --ia32 --publish always"
2121
},
22-
"author": "IOTA Foundation <contact@iota.org>",
22+
"author": "IOTA Foundation <info@iota.org>",
2323
"homepage": "https://www.iota.org",
2424
"repository": {
2525
"type": "git",
@@ -29,7 +29,7 @@
2929
"ffi": "^2.2.0",
3030
"fs-extra": "^1.0.0",
3131
"glob": "^7.1.1",
32-
"pidusage": "^1.1.1"
32+
"pidusage": "^1.1.0"
3333
},
3434
"devDependencies": {
3535
"electron": "^1.4.14",
@@ -45,19 +45,17 @@
4545
"publish": [
4646
"github"
4747
],
48-
"appId": "com.iotatoken.wallet",
48+
"appId": "com.iotatoken.wallet-testnet",
4949
"category": "public.app-category.developer-tools",
5050
"extraResources": [
51-
"iri/iri.jar",
51+
"iri/iri-testnet.jar",
5252
"ccurl/**/*",
5353
"ui/**/*"
5454
],
5555
"protocols": [
5656
{
5757
"name": "IOTA URL Scheme",
58-
"schemes": [
59-
"iota"
60-
]
58+
"schemes": ["iota"]
6159
}
6260
],
6361
"dmg": {
@@ -84,7 +82,8 @@
8482
"AppImage",
8583
"deb",
8684
"rpm",
87-
"tar.gz"
85+
"tar.gz",
86+
"snap"
8887
],
8988
"packageUrl": "https://www.iota.org/"
9089
}

ui/js/ui.spam.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var UI = (function(UI, $, undefined) {
22
var spamCount = 0;
33

4-
UI.showNetworkSpammer = function() {
4+
UI.showNetworkSpammer = function() {
55
/*
66
if (connection.isProofOfWorking) {
77
UI.notify("error", "Proof of work is busy, cannot spam.");
@@ -53,7 +53,12 @@ var UI = (function(UI, $, undefined) {
5353
$("#spam-msg").hide();
5454
}
5555
}
56-
callback(null);
56+
57+
// 1sec delay for each spam
58+
setTimeout(function() {
59+
callback(null);
60+
}, 1000)
61+
5762
});
5863
}, function() {
5964
return isSpamming == true;

0 commit comments

Comments
 (0)