diff --git a/README.md b/README.md index 83ae504..5e6e693 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,31 @@ -# Iguana Desktop App +# Agama Desktop App Desktop App for SuperNET DAPPs #### For Developers You must have `node.js` and `npm` installed on your machine. -Clone Iguana Desktop App with EasyDEX-GUI submodule +Clone Agama Desktop App with EasyDEX-GUI submodule ```shell -git clone --recursive https://github.com/SuperNETorg/iguana.git +git clone --recursive https://github.com/SuperNETorg/Agama.git cd gui/EasyDEX-GUI/ git checkout master git pull cd ../../ ``` -Install Iguana App +Install Agama App ```shell cd iguana npm install ``` -Then start Iguana App +Then start Agama App ```shell npm start ``` #### For end users -The instructions to make production build of Iguana App will be updated soon. +The instructions to make production build of Agama App will be updated soon. To build the production ready app, install `electron-packager` and `electron-prebuilt` packages from npm ```shell @@ -40,7 +40,7 @@ Refer to the original [electron-packager](https://github.com/electron-userland/e Change directory to iguana and execute the following command to build the Linux app ```shell cd iguana -electron-packager . --platform=linux --arch=x64 --icon=assets/icons/iguana_app_icon_png/128x128.png --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/win64 --ignore=assets/bin/osx --overwrite +electron-packager . --platform=linux --arch=x64 --icon=assets/icons/agama_icons/128x128.png --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/win64 --ignore=assets/bin/osx --overwrite ``` change architecture build parameter to ```--arch=x32``` for 32 bit build @@ -48,20 +48,20 @@ change architecture build parameter to ```--arch=x32``` for 32 bit build Change directory to iguana and execute the following command to build the OSX app ```shell cd iguana -electron-packager . --platform=darwin --arch=x64 --icon=assets/icons/iguana_app_icon.icns --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/win64 --ignore=assets/bin/linux64 --overwrite +electron-packager . --platform=darwin --arch=x64 --icon=assets/icons/agama_icons/agama_app_icon.icns --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/win64 --ignore=assets/bin/linux64 --overwrite ``` ##### Windows Change directory to iguana and execute the following command to build the Windows app ```shell dir iguana -electron-packager . --platform=win32 --arch=x64 --icon=assets/icons/iguana_app_icon.ico --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/osx --ignore=assets/bin/linux64 --overwrite +electron-packager . --platform=win32 --arch=x64 --icon=assets/icons/agama_icons/agama_app_icon.ico --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/osx --ignore=assets/bin/linux64 --overwrite # If generating 32bit desktop package -electron-packager . --platform=win32 --arch=ia32 --icon=assets/icons/iguana_app_icon.ico --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/osx --ignore=assets/bin/linux64 --overwrite +electron-packager . --platform=win32 --arch=ia32 --icon=assets/icons/agama_icons/agama_app_icon.ico --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/osx --ignore=assets/bin/linux64 --overwrite # To build both x64 and x86 desktop package -electron-packager . --platform=win32 --arch=all --icon=assets/icons/iguana_app_icon.ico --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/osx --ignore=assets/bin/linux64 --overwrite +electron-packager . --platform=win32 --arch=all --icon=assets/icons/agama_icons/agama_app_icon.ico --out=build/ --buildVersion=VERSION_NUMBER_HERE --ignore=assets/bin/osx --ignore=assets/bin/linux64 --overwrite ``` change architecture build parameter to ```--arch=x64``` for 64 bit build @@ -71,4 +71,4 @@ change architecture build parameter to ```--arch=x64``` for 64 bit build ### Windows DLL issues On Windows it's noticed iguana.exe complains about `VCRUNTIME140D.DLL` and `ucrtbased.dll` file. -Please see **windeps** directory and README file for instructions to install the required DLL files on Windows, and then try again running Iguana App. +Please see **windeps** directory and README file for instructions to install the required DLL files on Windows, and then try again running Agama App. diff --git a/assets/bin/linux64/iguana b/assets/bin/linux64/iguana index 79ef22f..31140a9 100755 Binary files a/assets/bin/linux64/iguana and b/assets/bin/linux64/iguana differ diff --git a/assets/bin/linux64/komodo-cli b/assets/bin/linux64/komodo-cli index 8979f61..c03abd1 100755 Binary files a/assets/bin/linux64/komodo-cli and b/assets/bin/linux64/komodo-cli differ diff --git a/assets/bin/linux64/komodod b/assets/bin/linux64/komodod index a844d2a..0093a44 100755 Binary files a/assets/bin/linux64/komodod and b/assets/bin/linux64/komodod differ diff --git a/assets/bin/osx/iguana b/assets/bin/osx/iguana index fe62e54..1bf5942 100755 Binary files a/assets/bin/osx/iguana and b/assets/bin/osx/iguana differ diff --git a/assets/bin/osx/komodo-cli b/assets/bin/osx/komodo-cli index 85a25b0..e84c603 100755 Binary files a/assets/bin/osx/komodo-cli and b/assets/bin/osx/komodo-cli differ diff --git a/assets/bin/osx/komodod b/assets/bin/osx/komodod index 3c60bcb..65cccf3 100755 Binary files a/assets/bin/osx/komodod and b/assets/bin/osx/komodod differ diff --git a/assets/bin/osx/libnanomsg.5.0.0.dylib b/assets/bin/osx/libnanomsg.5.0.0.dylib index e578b65..42ab613 100644 Binary files a/assets/bin/osx/libnanomsg.5.0.0.dylib and b/assets/bin/osx/libnanomsg.5.0.0.dylib differ diff --git a/assets/bin/win64/komodo-cli.exe b/assets/bin/win64/komodo-cli.exe old mode 100755 new mode 100644 index 9652926..eb0c096 Binary files a/assets/bin/win64/komodo-cli.exe and b/assets/bin/win64/komodo-cli.exe differ diff --git a/assets/bin/win64/komodod.exe b/assets/bin/win64/komodod.exe old mode 100755 new mode 100644 index a41bfc6..c7516c2 Binary files a/assets/bin/win64/komodod.exe and b/assets/bin/win64/komodod.exe differ diff --git a/assets/icons/agama_icons/128x128.png b/assets/icons/agama_icons/128x128.png new file mode 100755 index 0000000..a321a61 Binary files /dev/null and b/assets/icons/agama_icons/128x128.png differ diff --git a/assets/icons/agama_icons/16x16.png b/assets/icons/agama_icons/16x16.png new file mode 100755 index 0000000..5a024d2 Binary files /dev/null and b/assets/icons/agama_icons/16x16.png differ diff --git a/assets/icons/agama_icons/24x24.png b/assets/icons/agama_icons/24x24.png new file mode 100755 index 0000000..a8eac51 Binary files /dev/null and b/assets/icons/agama_icons/24x24.png differ diff --git a/assets/icons/agama_icons/256x256.png b/assets/icons/agama_icons/256x256.png new file mode 100755 index 0000000..13b83f3 Binary files /dev/null and b/assets/icons/agama_icons/256x256.png differ diff --git a/assets/icons/agama_icons/32x32.png b/assets/icons/agama_icons/32x32.png new file mode 100755 index 0000000..436aa99 Binary files /dev/null and b/assets/icons/agama_icons/32x32.png differ diff --git a/assets/icons/agama_icons/48x48.png b/assets/icons/agama_icons/48x48.png new file mode 100755 index 0000000..83fab1b Binary files /dev/null and b/assets/icons/agama_icons/48x48.png differ diff --git a/assets/icons/agama_icons/64x64.png b/assets/icons/agama_icons/64x64.png new file mode 100755 index 0000000..d6ff190 Binary files /dev/null and b/assets/icons/agama_icons/64x64.png differ diff --git a/assets/icons/agama_icons/96x96.png b/assets/icons/agama_icons/96x96.png new file mode 100755 index 0000000..faeedb0 Binary files /dev/null and b/assets/icons/agama_icons/96x96.png differ diff --git a/assets/icons/agama_icons/agama_app_icon.icns b/assets/icons/agama_icons/agama_app_icon.icns new file mode 100644 index 0000000..f2f956f Binary files /dev/null and b/assets/icons/agama_icons/agama_app_icon.icns differ diff --git a/assets/icons/agama_icons/agama_app_icon.ico b/assets/icons/agama_icons/agama_app_icon.ico new file mode 100644 index 0000000..a34d763 Binary files /dev/null and b/assets/icons/agama_icons/agama_app_icon.ico differ diff --git a/main.js b/main.js index 872fc12..f60c5d1 100644 --- a/main.js +++ b/main.js @@ -24,7 +24,8 @@ var express = require('express'), Promise = require('bluebird'); -app.setName('Iguana'); +app.setName('Agama'); +app.setVersion('0.1.5.6e-beta'); if (os.platform() === 'linux') { process.env.ELECTRON_RUN_AS_NODE = true; @@ -55,6 +56,12 @@ process.once('loaded', () => { if (os.platform() === 'darwin') { process.setFdLimit(appConfig.maxDescriptors.darwin); + app.setAboutPanelOptions({ + applicationName: app.getName(), + applicationVersion: app.getVersion(), + copyright: "Released under the MIT license", + credits: "SuperNET Team" + }) } if (os.platform() === 'linux') { process.setFdLimit(appConfig.maxDescriptors.linux); @@ -144,10 +151,10 @@ if (os.platform() === 'win32') { */ if (os.platform() === 'linux') { - var iguanaIcon = path.join(__dirname, '/assets/icons/iguana_app_icon_png/128x128.png'); + var iguanaIcon = path.join(__dirname, '/assets/icons/agama_icons/128x128.png'); } if (os.platform() === 'win32') { - var iguanaIcon = path.join(__dirname, '/assets/icons/iguana_app_icon.ico'); + var iguanaIcon = path.join(__dirname, '/assets/icons/agama_icons/agama_app_icon.ico'); } //console.log(iguanaDir); diff --git a/package.json b/package.json index ff2e3b2..327c6ba 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "iguana_app", "productName": "Agama", - "version": "0.1.0", + "version": "0.1.5", "description": "iguana Desktop App", "main": "main.js", "scripts": { @@ -25,7 +25,7 @@ "bluebird": "^3.4.7", "body-parser": "^1.15.2", "corsproxy": "^1.5.0", - "electron": "^1.4.15", + "electron": "^1.6.4", "express": "^4.14.0", "fix-path": "^2.1.0", "fs-extra": "^1.0.0", diff --git a/routes/cache.js b/routes/cache.js index 91742f8..c1b7b41 100644 --- a/routes/cache.js +++ b/routes/cache.js @@ -314,231 +314,9 @@ cache.one = function(req, res, next) { } } }); - // update all available coin addresses - if (!address) { - cache.io.emit('messages', { - 'message': { - 'shepherd': { - 'method': 'cache-one', - 'status': 'in progress', - 'iguanaAPI': { - 'method': 'getaddressesbyaccount', - 'coin': coin, - 'status': 'in progress' - } - } - } - }); - - function getAddresses(coin) { - var tempUrl = 'http://' + cache.appConfig.host + ':' + cache.appConfig.iguanaCorePort + '/api/bitcoinrpc/getaddressesbyaccount?userpass=' + sessionKey + '&coin=' + coin + '&account=*'; - request({ - url: mock ? 'http://localhost:17777/shepherd/mock?url=' + tempUrl : tempUrl, - method: 'GET' - }, function (error, response, body) { - if (response && response.statusCode && response.statusCode === 200) { - cache.io.emit('messages', { - 'message': { - 'shepherd': { - 'method': 'cache-one', - 'status': 'in progress', - 'iguanaAPI': { - 'method': 'getaddressesbyaccount', - 'coin': coin, - 'status': 'done', - 'resp': body - } - } - } - }); - outObj.basilisk[coin].addresses = JSON.parse(body).result; - console.log(JSON.parse(body).result); - writeCache(); - var addrCount = outObj.basilisk[coin].addresses ? outObj.basilisk[coin].addresses.length : 0; - callStack[coin] = callStack[coin] + addrCount * (coin === 'BTC' || coin === 'SYS' ? callsArray.length - 2 : callsArray.length); - console.log(coin + ' stack len ' + callStack[coin]); - - async.each(outObj.basilisk[coin].addresses, function(address) { - var dexUrls = { - 'listunspent': 'http://' + cache.appConfig.host + ':' + cache.appConfig.iguanaCorePort + '/api/dex/listunspent?userpass=' + sessionKey + '&symbol=' + coin + '&address=' + address, - 'listtransactions': 'http://' + cache.appConfig.host + ':' + cache.appConfig.iguanaCorePort + '/api/dex/listtransactions?userpass=' + sessionKey + '&count=100&skip=0&symbol=' + coin + '&address=' + address, - 'getbalance': 'http://' + cache.appConfig.host + ':' + cache.appConfig.iguanaCorePort + '/api/dex/getbalance?userpass=' + sessionKey + '&symbol=' + coin + '&address=' + address, - 'refresh': 'http://' + cache.appConfig.host + ':' + cache.appConfig.iguanaCorePort + '/api/basilisk/refresh?userpass=' + sessionKey + '&timeout=600000&symbol=' + coin + '&address=' + address - }, - _dexUrls = {}; - - for (var a = 0; a < callsArray.length; a++) { - _dexUrls[callsArray[a]] = dexUrls[callsArray[a]]; - } - if (coin === 'BTC' || coin === 'SYS') { - delete _dexUrls.refresh; - delete _dexUrls.getbalance; - } - //console.log(JSON.stringify(dexUrls)); - console.log(coin + ' address ' + address); - if (!outObj.basilisk[coin][address]) { - outObj.basilisk[coin][address] = {}; - writeCache(); - } - - // set current call status - async.forEachOf(_dexUrls, function(dexUrl, key) { - if (!outObj.basilisk[coin][address][key]) { - outObj.basilisk[coin][address][key] = {}; - outObj.basilisk[coin][address][key].status = 'waiting'; - } else { - outObj.basilisk[coin][address][key].status = 'waiting'; - } - }); - writeCache(); - - async.forEachOf(_dexUrls, function(dexUrl, key) { - var tooEarly = false; - if (outObj.basilisk[coin][address][key] && - outObj.basilisk[coin][address][key].timestamp && - checkTimestamp(outObj.basilisk[coin][address][key].timestamp) < cacheGlobLifetime) { - tooEarly = true; - outObj.basilisk[coin][address][key].status = 'done'; - cache.io.emit('messages', { - 'message': { - 'shepherd': { - 'method': 'cache-one', - 'status': 'in progress', - 'iguanaAPI': { - 'method': key, - 'coin': coin, - 'address': address, - 'status': 'done', - 'resp': 'too early' - } - } - } - }); - } - tooEarly = skipTimeout ? false : tooEarly; - if (!tooEarly) { - cache.io.emit('messages', { - 'message': { - 'shepherd': { - 'method': 'cache-one', - 'status': 'in progress', - 'iguanaAPI': { - 'method': key, - 'coin': coin, - 'address': address, - 'status': 'in progress' - } - } - } - }); - outObj.basilisk[coin][address][key].status = 'in progress'; - request({ - url: mock ? 'http://localhost:17777/shepherd/mock?url=' + dexUrl : dexUrl, - method: 'GET' - }, function (error, response, body) { - if (response && response.statusCode && response.statusCode === 200) { - cache.io.emit('messages', { - 'message': { - 'shepherd': { - 'method': 'cache-one', - 'status': 'in progress', - 'iguanaAPI': { - 'method': key, - 'coin': coin, - 'address': address, - 'status': 'done', - 'resp': body - } - } - } - }); - outObj.basilisk[coin][address][key] = {}; - outObj.basilisk[coin][address][key].data = JSON.parse(body); - outObj.basilisk[coin][address][key].timestamp = Date.now(); // add timestamp - outObj.basilisk[coin][address][key].status = 'done'; - console.log(dexUrl); - console.log(body); - callStack[coin]--; - console.log(coin + ' _stack len ' + callStack[coin]); - checkCallStack(); - - writeCache(); - } - }); - } else { - console.log(key + ' is fresh, check back in ' + (cacheGlobLifetime - checkTimestamp(outObj.basilisk[coin][address][key].timestamp)) + 's'); - callStack[coin]--; - console.log(coin + ' _stack len ' + callStack[coin]); - checkCallStack(); - } - }); - }); - } else { - // TODO: error - } - }); - } - if (coin === 'all') { - var tempUrl = 'http://' + cache.appConfig.host + ':' + cache.appConfig.iguanaCorePort + '/api/InstantDEX/allcoins?userpass=' + sessionKey; - request({ - url: mock ? 'http://localhost:17777/shepherd/mock?url=' + tempUrl : tempUrl, - method: 'GET' - }, function (error, response, body) { - if (response && response.statusCode && response.statusCode === 200) { - console.log(JSON.parse(body).basilisk); - cache.io.emit('messages', { - 'message': { - 'shepherd': { - 'method': 'cache-one', - 'status': 'in progress', - 'iguanaAPI': { - 'method': 'allcoins', - 'status': 'done', - 'resp': body - } - } - } - }); - body = JSON.parse(body); - // basilisk coins - if (body.basilisk && body.basilisk.length) { - // get coin addresses - async.each(body.basilisk, function(coin) { - callStack[coin] = 1; - }); - - async.each(body.basilisk, function(coin) { - outObj.basilisk[coin] = {}; - writeCache(); - - cache.io.emit('messages', { - 'message': { - 'shepherd': { - 'method': 'cache-one', - 'status': 'in progress', - 'iguanaAPI': { - 'method': 'getaddressesbyaccount', - 'coin': coin, - 'status': 'in progress' - } - } - } - }); - - getAddresses(coin); - }); - } - } - }); - } else { - getAddresses(coin); - } - } else { - callStack[coin] = callStack[coin] + (coin === 'BTC' ? callsArray.length : callsArray.length - 2); - console.log(coin + ' stack len ' + callStack[coin]); - - var dexUrls = { + function execDEXRequests(address, coin) { + let dexUrls = { 'listunspent': 'http://' + cache.appConfig.host + ':' + cache.appConfig.iguanaCorePort + '/api/dex/listunspent?userpass=' + sessionKey + '&symbol=' + coin + '&address=' + address, 'listtransactions': 'http://' + cache.appConfig.host + ':' + cache.appConfig.iguanaCorePort + '/api/dex/listtransactions?userpass=' + sessionKey + '&count=100&skip=0&symbol=' + coin + '&address=' + address, 'getbalance': 'http://' + cache.appConfig.host + ':' + cache.appConfig.iguanaCorePort + '/api/dex/getbalance?userpass=' + sessionKey + '&symbol=' + coin + '&address=' + address, @@ -549,17 +327,17 @@ cache.one = function(req, res, next) { for (var a = 0; a < callsArray.length; a++) { _dexUrls[callsArray[a]] = dexUrls[callsArray[a]]; } + if (coin === 'BTC' || coin === 'SYS') { delete _dexUrls.refresh; delete _dexUrls.getbalance; } - //console.log(JSON.stringify(dexUrls)); + console.log(coin + ' address ' + address); if (!outObj.basilisk[coin][address]) { outObj.basilisk[coin][address] = {}; writeCache(); } - console.log(_dexUrls); // set current call status async.forEachOf(_dexUrls, function(dexUrl, key) { @@ -612,7 +390,7 @@ cache.one = function(req, res, next) { }); outObj.basilisk[coin][address][key].status = 'in progress'; request({ - url: dexUrl, + url: mock ? 'http://localhost:17777/shepherd/mock?url=' + dexUrl : dexUrl, method: 'GET' }, function (error, response, body) { if (response && response.statusCode && response.statusCode === 200) { @@ -643,6 +421,16 @@ cache.one = function(req, res, next) { writeCache(); } + if (error || !body || !response) { + outObj.basilisk[coin][address][key] = {}; + outObj.basilisk[coin][address][key].data = { 'error': 'request failed' }; + outObj.basilisk[coin][address][key].timestamp = 1471620867 // add timestamp + outObj.basilisk[coin][address][key].status = 'done'; + callStack[coin]--; + console.log(coin + ' _stack len ' + callStack[coin]); + checkCallStack(); + writeCache(); + } }); } else { console.log(key + ' is fresh, check back in ' + (cacheGlobLifetime - checkTimestamp(outObj.basilisk[coin][address][key].timestamp)) + 's'); @@ -652,6 +440,132 @@ cache.one = function(req, res, next) { } }); } + + function getAddresses(coin) { + var tempUrl = 'http://' + cache.appConfig.host + ':' + cache.appConfig.iguanaCorePort + '/api/bitcoinrpc/getaddressesbyaccount?userpass=' + sessionKey + '&coin=' + coin + '&account=*'; + request({ + url: mock ? 'http://localhost:17777/shepherd/mock?url=' + tempUrl : tempUrl, + method: 'GET' + }, function (error, response, body) { + if (response && response.statusCode && response.statusCode === 200) { + cache.io.emit('messages', { + 'message': { + 'shepherd': { + 'method': 'cache-one', + 'status': 'in progress', + 'iguanaAPI': { + 'method': 'getaddressesbyaccount', + 'coin': coin, + 'status': 'done', + 'resp': body + } + } + } + }); + outObj.basilisk[coin].addresses = JSON.parse(body).result; + console.log(JSON.parse(body).result); + writeCache(); + var addrCount = outObj.basilisk[coin].addresses ? outObj.basilisk[coin].addresses.length : 0; + var callsArrayBTC = callsArray.length; + if (callsArray.indexOf('getbalance') > - 1) { + callsArrayBTC--; + } + if (callsArray.indexOf('refresh') > - 1) { + callsArrayBTC--; + } + callStack[coin] = callStack[coin] + addrCount * (coin === 'BTC' || coin === 'SYS' ? callsArrayBTC : callsArray.length); + console.log(coin + ' stack len ' + callStack[coin]); + + async.each(outObj.basilisk[coin].addresses, function(address) { + execDEXRequests(address, coin); + }); + } else { + // TODO: error + } + }); + } + + // update all available coin addresses + if (!address) { + cache.io.emit('messages', { + 'message': { + 'shepherd': { + 'method': 'cache-one', + 'status': 'in progress', + 'iguanaAPI': { + 'method': 'getaddressesbyaccount', + 'coin': coin, + 'status': 'in progress' + } + } + } + }); + + if (coin === 'all') { + var tempUrl = 'http://' + cache.appConfig.host + ':' + cache.appConfig.iguanaCorePort + '/api/InstantDEX/allcoins?userpass=' + sessionKey; + request({ + url: mock ? 'http://localhost:17777/shepherd/mock?url=' + tempUrl : tempUrl, + method: 'GET' + }, function (error, response, body) { + if (response && response.statusCode && response.statusCode === 200) { + console.log(JSON.parse(body).basilisk); + cache.io.emit('messages', { + 'message': { + 'shepherd': { + 'method': 'cache-one', + 'status': 'in progress', + 'iguanaAPI': { + 'method': 'allcoins', + 'status': 'done', + 'resp': body + } + } + } + }); + body = JSON.parse(body); + // basilisk coins + if (body.basilisk && body.basilisk.length) { + // get coin addresses + async.each(body.basilisk, function(coin) { + callStack[coin] = 1; + }); + + async.each(body.basilisk, function(coin) { + outObj.basilisk[coin] = {}; + writeCache(); + + cache.io.emit('messages', { + 'message': { + 'shepherd': { + 'method': 'cache-one', + 'status': 'in progress', + 'iguanaAPI': { + 'method': 'getaddressesbyaccount', + 'coin': coin, + 'status': 'in progress' + } + } + } + }); + + getAddresses(coin); + }); + } + } + if (error) { // stop further requests on failure, exit + callStack[coin] = 1; + checkCallStack(); + } + }); + } else { + getAddresses(coin); + } + } else { + callStack[coin] = callStack[coin] + (coin === 'BTC' ? callsArray.length : callsArray.length - 2); + console.log(coin + ' stack len ' + callStack[coin]); + + execDEXRequests(coin, address); + } } else { cache.io.emit('messages', { 'message': { diff --git a/routes/mock.js b/routes/mock.js new file mode 100644 index 0000000..39e4156 --- /dev/null +++ b/routes/mock.js @@ -0,0 +1,39 @@ +const fs = require('fs-extra'), + request = require('request'), + async = require('async'), + url = require('url'); + +var mock = {}; + +mock.setVar = function(variable, value) { + mock[variable] = value; +} + +mock.get = function(req, res, next) { + var _url = req.query.url; + + if (_url.indexOf('/InstantDEX/allcoins') > -1) { + res.end(JSON.stringify({ + 'native': [], + 'basilisk': [ 'KMD', 'BTC'], + 'full':[], + 'tag': '18430609759584422959' + })); + } + if (_url.indexOf('/bitcoinrpc/getaddressesbyaccount') > -1) { + console.log(_url.indexOf('/bitcoinrpc/getaddressesbyaccount')); + res.end(JSON.stringify({ + 'result': ["RDbGxL8QYdEp8sMULaVZS2E6XThcTKT9Jd","RL4orv22Xch7PhM5w9jUHhVQhX6kF6GkfS","RUrxvPTEKGWEDTvAtgiqbUTTFE53Xdpj8a","RPJoLDa7RezvfUUBr7R3U8wrP16AgUsNw3","RQPTpRJEeafNx5hkDzgjcsPyU4E8RFVApT"] + })); + } + if (_url.indexOf('/api/dex/listunspent') > -1 || + _url.indexOf('/api/dex/listtransactions') > -1 || + _url.indexOf('/api/ss/getbalance') > -1 || + _url.indexOf('/api/ww/refresh') > -1) { + res.end(JSON.stringify({ + 'some key': 'some value' + })); + } +} + +module.exports = mock; \ No newline at end of file diff --git a/routes/shepherd.js b/routes/shepherd.js index 5fe3f75..ccc5129 100644 --- a/routes/shepherd.js +++ b/routes/shepherd.js @@ -48,7 +48,7 @@ if (os.platform() === 'linux') { var iguanaBin = path.join(__dirname, '../assets/bin/linux64/iguana'), iguanaDir = process.env.HOME + '/.iguana', iguanaConfsDir = iguanaDir + '/confs', - iguanaIcon = path.join(__dirname, '/assets/icons/iguana_app_icon_png/128x128.png'), + iguanaIcon = path.join(__dirname, '/assets/icons/agama_icons/128x128.png'), komododBin = path.join(__dirname, '../assets/bin/linux64/komodod'), komodocliBin = path.join(__dirname, '../assets/bin/linux64/komodo-cli'), komodoDir = process.env.HOME + '/.komodo'; @@ -61,7 +61,7 @@ if (os.platform() === 'win32') { iguanaDir = path.normalize(iguanaDir); iguanaConfsDir = process.env.APPDATA + '/iguana/confs'; iguanaConfsDir = path.normalize(iguanaConfsDir); - iguanaIcon = path.join(__dirname, '/assets/icons/iguana_app_icon.ico'), + iguanaIcon = path.join(__dirname, '/assets/icons/agama_icons/agama_app_icon.ico'), iguanaConfsDirSrc = path.normalize(iguanaConfsDirSrc); komododBin = path.join(__dirname, '../assets/bin/win64/komodod.exe'),