diff --git a/README.md b/README.md index 22318b2..fe481ef 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,38 @@ Then start Agama App npm start ``` +### Important dev notes +#### Use the following config.json for dev +Place it in ./iguana folder. +``` +{ +"edexGuiOnly": true, +"iguanaGuiOnly": false, +"manualIguanaStart": false, +"skipBasiliskNetworkCheck": true, +"minNotaries": 8, +"host": "127.0.0.1", +"agamaPort": 17777, +"iguanaCorePort": 7778, +"maxDescriptors": { +"darwin": 90000, +"linux": 1000000 +}, +"killIguanaOnStart": true, +"dev": true, +"v2": true, +"useBasiliskInstance": true, +"debug": true, +"iguanaAppPort": 17777, +"forks": { +"basilisk": false, +"all": false +} +} +``` +#### Sockets.io +In dev mode backend is configured to send/receive messages from/to http://127.0.0.1:3000 address. If you open it as http://localhost:3000 sockets server will reject any messages. + #### For end users The instructions to make production build of Agama App will be updated soon. diff --git a/assets/BitRock Installer Files/IgaunaApp-Linux.xml b/assets/BitRock Installer Files/IgaunaApp-Linux.xml index 70e220f..01f6d16 100755 --- a/assets/BitRock Installer Files/IgaunaApp-Linux.xml +++ b/assets/BitRock Installer Files/IgaunaApp-Linux.xml @@ -110,11 +110,22 @@ + + xdg-user-dir + DESKTOP + desktopDir + + + is_in_path + xdg-user-dir + + + previous_installation_exists 1 - + @@ -125,7 +136,7 @@ - /etc/${project.vendor}-${project.shortName}.ini + ${user_home_directory}/.${project.vendor}-${project.shortName}.ini ${name}
details
${variable} @@ -177,6 +188,28 @@ + + Deleting user data + ${user_home_directory}/.config/Agama + Deleting user data + + + equals + ${previous_installation_exists} + 1 + + + equals + ${installation_type} + uninstall + + + equals + ${delete_user_data} + 1 + + + Deleting zcash params ${user_home_directory}/.zcash-params @@ -215,6 +248,16 @@ + + Deleting user data + ${user_home_directory}/.iguana/shepherd + Deleting user data + + + Deleting user data + ${user_home_directory}/.iguana/config.json + Deleting user data + 0 Creating ZcashParam directory @@ -279,23 +322,18 @@ 0 - /bin/Agama + ${user_home_directory}/bin/Agama ${installdir}/Agama - ${user_home_directory}/Desktop/Agama Desktop.desktop + ${desktopDir}/Agama Desktop.desktop Categories
Desktop Entry
Office;
- - ${user_home_directory}/Desktop/Agama Desktop.desktop - users - nobody - - /usr/share/applications/Agama Desktop.desktop - ${user_home_directory}/Desktop/Agama Desktop.desktop + ${user_home_directory}/.local/share/applications/Agama Desktop.desktop + ${desktopDir}/Agama Desktop.desktop @@ -304,7 +342,7 @@ name variable - /etc/${project.vendor}-${project.shortName}.ini + ${user_home_directory}/.${project.vendor}-${project.shortName}.ini ${name}
details
${variable} @@ -314,7 +352,7 @@ - +
@@ -328,16 +366,14 @@ 0 1 1 - 1 1 Uninstall-Agama SuperNETOrg - /bin/Agama + ${user_home_directory}/bin/Agama & Do you want to launch ${project.fullName} now? - $USER @@ -346,7 +382,7 @@ Installer.Parameter.installdir.description Installer.Parameter.installdir.explanation - /opt/AgamaApp + ${user_home_directory}/.AgamaApp 0 prefix 1 @@ -393,8 +429,8 @@ - - Re-install + + Upgrade diff --git a/assets/BitRock Installer Files/IgaunaApp-OSX.xml b/assets/BitRock Installer Files/IgaunaApp-OSX.xml index deaa5c2..caacc26 100755 --- a/assets/BitRock Installer Files/IgaunaApp-OSX.xml +++ b/assets/BitRock Installer Files/IgaunaApp-OSX.xml @@ -96,7 +96,29 @@ Deleting user data - ${user_home_directory}/Library/Application Support/Iguana + ${user_home_directory}/Library/Application Support/Agama + Deleting user data + + + equals + ${previous_installation_exists} + 1 + + + equals + ${installation_type} + uninstall + + + equals + ${delete_user_data} + 1 + + + + + Deleting user data + ${user_home_directory}/Library/Application Support/iguana Deleting user data @@ -154,6 +176,16 @@ + + Deleting user data + ${user_home_directory}/Library/Application Support/iguana/shepherd + Deleting user data + + + Deleting user data + ${user_home_directory}/Library/Application Support/iguana/config.json + Deleting user data + 0 Creating ZcashParam directory @@ -304,8 +336,8 @@ - - Re-install + + Upgrade diff --git a/assets/BitRock Installer Files/IgaunaApp-Win.xml b/assets/BitRock Installer Files/IgaunaApp-Win.xml index f4e1d35..b2ebf69 100755 --- a/assets/BitRock Installer Files/IgaunaApp-Win.xml +++ b/assets/BitRock Installer Files/IgaunaApp-Win.xml @@ -217,6 +217,28 @@ + + Deleting user data + ${windows_folder_appdata}/Iguana + Deleting user data + + + equals + ${previous_installation_exists} + 1 + + + equals + ${installation_type} + uninstall + + + equals + ${delete_user_data} + 1 + + + Deleting zcash params ${windows_folder_appdata}/ZcashParams/ @@ -255,6 +277,16 @@ + + Deleting user data + ${windows_folder_appdata}/Iguana/shepherd + Deleting user data + + + Deleting user data + ${windows_folder_appdata}/Iguana/config.json + Deleting user data + Downloading files @@ -494,8 +526,8 @@ - - Re-install + + Upgrade diff --git a/buildscripts/easydex-build.sh b/buildscripts/easydex-build.sh index 26c65c2..7b634ed 100755 --- a/buildscripts/easydex-build.sh +++ b/buildscripts/easydex-build.sh @@ -14,11 +14,10 @@ git pull origin redux [ -d react ] && cd react || echo "!!! I can't find react" echo "Actual directory is: ${PWD}" - echo "Installing nodejs modules." npm install npm install webpack echo "Building EasyDEX-GUI app." npm run build -echo "EasyDEX-GUI is built!" \ No newline at end of file +echo "EasyDEX-GUI is built!" diff --git a/gui/EasyDEX-GUI b/gui/EasyDEX-GUI index 490ddb4..72c3a47 160000 --- a/gui/EasyDEX-GUI +++ b/gui/EasyDEX-GUI @@ -1 +1 @@ -Subproject commit 490ddb48a4472dfd9abf8792674a83688fdae0d3 +Subproject commit 72c3a472674774be19dbd4a512b44e2fbc41d34d diff --git a/main.js b/main.js index d986083..25cbaa8 100644 --- a/main.js +++ b/main.js @@ -298,10 +298,14 @@ function createWindow (status) { if (appConfig.edexGuiOnly) { if (appConfig.v2) { shepherd.writeLog('show edex gui'); - //mainWindow.loadURL('http://127.0.0.1:3000'); mainWindow.appConfig = appConfig; mainWindow.appSessionHash = appSessionHash; - mainWindow.loadURL('http://' + appConfig.host + ':' + appConfig.agamaPort + '/gui/EasyDEX-GUI/react/build'); + + if (appConfig.dev) { + mainWindow.loadURL('http://127.0.0.1:3000'); + } else { + mainWindow.loadURL('http://' + appConfig.host + ':' + appConfig.agamaPort + '/gui/EasyDEX-GUI/react/build'); + } } else { shepherd.writeLog('show edex gui'); mainWindow.loadURL('http://' + appConfig.host + ':' + appConfig.agamaPort + '/gui/EasyDEX-GUI/'); diff --git a/routes/cache.js b/routes/cache.js index 2a83617..3885102 100644 --- a/routes/cache.js +++ b/routes/cache.js @@ -514,6 +514,16 @@ cache.one = function(req, res, next) { } } }); + + // basilisk balance fallback + const _parsedJSON = JSON.parse(body); + if (key === 'getbalance' && + coin === 'KMD'/* && + ((_parsedJSON && _parsedJSON.balance === 0) || _parsedJSON === [])*/) { + console.log('fallback to kmd explorer'); + //http://kmd.explorer.supernet.org/api/addr/RDbGxL8QYdEp8sMULaVZS2E6XThcTKT9Jd/?noTxList=1 + } + outObj.basilisk[coin][address][key] = {}; outObj.basilisk[coin][address][key].data = JSON.parse(body); outObj.basilisk[coin][address][key].timestamp = Date.now(); // add timestamp diff --git a/routes/shepherd.js b/routes/shepherd.js index d3723b3..a4eb0e2 100644 --- a/routes/shepherd.js +++ b/routes/shepherd.js @@ -280,6 +280,50 @@ shepherd.quitKomodod = function(chain) { }); } +/* + * type: POST + * params: payload + */ +shepherd.post('/cli', function(req, res, next) { + if (!req.body.payload) { + const errorObj = { + 'msg': 'error', + 'result': 'no payload provided' + }; + + res.end(JSON.stringify(errorObj)); + } else { + const _mode = req.body.payload.mode === 'passthru' ? 'passthru' : 'default'; + const _chain = req.body.payload.chain ? req.body.payload.chain : ''; + const _cmd = req.body.payload.cmd; + + exec(komodocliBin + (_chain ? ' ac_name=' + _chain : '') + ' ' + _cmd, function(error, stdout, stderr) { + console.log('stdout: ' + stdout) + console.log('stderr: ' + stderr) + + if (error !== null) { + console.log('exec error: ' + error) + } + + let responseObj; + + if (stderr) { + responseObj = { + 'msg': 'error', + 'result': stderr + }; + } else { + responseObj = { + 'msg': 'success', + 'result': stdout + }; + } + + res.end(JSON.stringify(responseObj)); + }); + } +}); + /* * type: POST * params: payload