Browse Source

merge master to pkg_auomtation branch

pkg_automation_electrum
michal maxian 8 years ago
parent
commit
535fc2baeb
  1. 32
      README.md
  2. 74
      assets/BitRock Installer Files/IgaunaApp-Linux.xml
  3. 38
      assets/BitRock Installer Files/IgaunaApp-OSX.xml
  4. 36
      assets/BitRock Installer Files/IgaunaApp-Win.xml
  5. 1
      buildscripts/easydex-build.sh
  6. 2
      gui/EasyDEX-GUI
  7. 6
      main.js
  8. 10
      routes/cache.js
  9. 44
      routes/shepherd.js

32
README.md

@ -24,6 +24,38 @@ Then start Agama App
npm start 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 #### For end users
The instructions to make production build of Agama App will be updated soon. The instructions to make production build of Agama App will be updated soon.

74
assets/BitRock Installer Files/IgaunaApp-Linux.xml

@ -110,11 +110,22 @@
</component> </component>
</componentList> </componentList>
<preInstallationActionList> <preInstallationActionList>
<setInstallerVariableFromScriptOutput>
<exec>xdg-user-dir</exec>
<execArgs>DESKTOP</execArgs>
<name>desktopDir</name>
<ruleList>
<programTest>
<condition>is_in_path</condition>
<name>xdg-user-dir</name>
</programTest>
</ruleList>
</setInstallerVariableFromScriptOutput>
<setInstallerVariable> <setInstallerVariable>
<name>previous_installation_exists</name> <name>previous_installation_exists</name>
<value>1</value> <value>1</value>
<ruleList> <ruleList>
<fileTest condition="exists" path="/etc/${project.vendor}-${project.shortName}.ini"/> <fileTest condition="exists" path="${user_home_directory}/.${project.vendor}-${project.shortName}.ini"/>
</ruleList> </ruleList>
</setInstallerVariable> </setInstallerVariable>
@ -125,7 +136,7 @@
<actionList> <actionList>
<setInstallerVariable name="${variable}" value=""/> <setInstallerVariable name="${variable}" value=""/>
<iniFileGet> <iniFileGet>
<file>/etc/${project.vendor}-${project.shortName}.ini</file> <file>${user_home_directory}/.${project.vendor}-${project.shortName}.ini</file>
<key>${name}</key> <key>${name}</key>
<section>details</section> <section>details</section>
<variable>${variable}</variable> <variable>${variable}</variable>
@ -177,6 +188,28 @@
</compareValues> </compareValues>
</ruleList> </ruleList>
</deleteFile> </deleteFile>
<deleteFile>
<explanation>Deleting user data</explanation>
<path>${user_home_directory}/.config/Agama</path>
<progressText>Deleting user data</progressText>
<ruleList>
<compareValues>
<logic>equals</logic>
<value1>${previous_installation_exists}</value1>
<value2>1</value2>
</compareValues>
<compareValues>
<logic>equals</logic>
<value1>${installation_type}</value1>
<value2>uninstall</value2>
</compareValues>
<compareValues>
<logic>equals</logic>
<value1>${delete_user_data}</value1>
<value2>1</value2>
</compareValues>
</ruleList>
</deleteFile>
<deleteFile> <deleteFile>
<explanation>Deleting zcash params</explanation> <explanation>Deleting zcash params</explanation>
<path>${user_home_directory}/.zcash-params</path> <path>${user_home_directory}/.zcash-params</path>
@ -215,6 +248,16 @@
</compareValues> </compareValues>
</ruleList> </ruleList>
</exit> </exit>
<deleteFile>
<explanation>Deleting user data</explanation>
<path>${user_home_directory}/.iguana/shepherd</path>
<progressText>Deleting user data</progressText>
</deleteFile>
<deleteFile>
<explanation>Deleting user data</explanation>
<path>${user_home_directory}/.iguana/config.json</path>
<progressText>Deleting user data</progressText>
</deleteFile>
<createDirectory> <createDirectory>
<abortOnError>0</abortOnError> <abortOnError>0</abortOnError>
<explanation>Creating ZcashParam directory</explanation> <explanation>Creating ZcashParam directory</explanation>
@ -279,23 +322,18 @@
<postInstallationActionList> <postInstallationActionList>
<createSymLink> <createSymLink>
<abortOnError>0</abortOnError> <abortOnError>0</abortOnError>
<linkName>/bin/Agama</linkName> <linkName>${user_home_directory}/bin/Agama</linkName>
<target>${installdir}/Agama</target> <target>${installdir}/Agama</target>
</createSymLink> </createSymLink>
<iniFileSet> <iniFileSet>
<file>${user_home_directory}/Desktop/Agama Desktop.desktop</file> <file>${desktopDir}/Agama Desktop.desktop</file>
<key>Categories</key> <key>Categories</key>
<section>Desktop Entry</section> <section>Desktop Entry</section>
<value>Office;</value> <value>Office;</value>
</iniFileSet> </iniFileSet>
<changeOwnerAndGroup>
<files>${user_home_directory}/Desktop/Agama Desktop.desktop</files>
<group>users</group>
<owner>nobody</owner>
</changeOwnerAndGroup>
<copyFile> <copyFile>
<destination>/usr/share/applications/Agama Desktop.desktop</destination> <destination>${user_home_directory}/.local/share/applications/Agama Desktop.desktop</destination>
<origin>${user_home_directory}/Desktop/Agama Desktop.desktop</origin> <origin>${desktopDir}/Agama Desktop.desktop</origin>
</copyFile> </copyFile>
<!-- Store values of current installer in etc folder so we can find for uninstal --> <!-- Store values of current installer in etc folder so we can find for uninstal -->
@ -304,7 +342,7 @@
<variables>name variable</variables> <variables>name variable</variables>
<actionList> <actionList>
<iniFileSet> <iniFileSet>
<file>/etc/${project.vendor}-${project.shortName}.ini</file> <file>${user_home_directory}/.${project.vendor}-${project.shortName}.ini</file>
<key>${name}</key> <key>${name}</key>
<section>details</section> <section>details</section>
<value>${variable}</value> <value>${variable}</value>
@ -314,7 +352,7 @@
<platformTest negate="1" type="windows"/> <platformTest negate="1" type="windows"/>
</ruleList> </ruleList>
</foreach> </foreach>
<addFilesToUninstaller files="/etc/${project.vendor}-${project.shortName}.ini"/> <addFilesToUninstaller files="${user_home_directory}/.${project.vendor}-${project.shortName}.ini"/>
</postInstallationActionList> </postInstallationActionList>
<postUninstallationActionList> <postUninstallationActionList>
<deleteFile> <deleteFile>
@ -328,16 +366,14 @@
<enableRollback>0</enableRollback> <enableRollback>0</enableRollback>
<enableSslSupport>1</enableSslSupport> <enableSslSupport>1</enableSslSupport>
<enableTimestamp>1</enableTimestamp> <enableTimestamp>1</enableTimestamp>
<requireInstallationByRootUser>1</requireInstallationByRootUser>
<saveRelativePaths>1</saveRelativePaths> <saveRelativePaths>1</saveRelativePaths>
<uninstallerName>Uninstall-Agama</uninstallerName> <uninstallerName>Uninstall-Agama</uninstallerName>
<vendor>SuperNETOrg</vendor> <vendor>SuperNETOrg</vendor>
<finalPageActionList> <finalPageActionList>
<runProgram> <runProgram>
<program>/bin/Agama</program> <program>${user_home_directory}/bin/Agama</program>
<programArguments>&amp;</programArguments> <programArguments>&amp;</programArguments>
<progressText>Do you want to launch ${project.fullName} now?</progressText> <progressText>Do you want to launch ${project.fullName} now?</progressText>
<runAs>$USER</runAs>
</runProgram> </runProgram>
</finalPageActionList> </finalPageActionList>
<parameterList> <parameterList>
@ -346,7 +382,7 @@
<description>Installer.Parameter.installdir.description</description> <description>Installer.Parameter.installdir.description</description>
<explanation>Installer.Parameter.installdir.explanation</explanation> <explanation>Installer.Parameter.installdir.explanation</explanation>
<value></value> <value></value>
<default>/opt/AgamaApp</default> <default>${user_home_directory}/.AgamaApp</default>
<allowEmptyValue>0</allowEmptyValue> <allowEmptyValue>0</allowEmptyValue>
<cliOptionName>prefix</cliOptionName> <cliOptionName>prefix</cliOptionName>
<mustBeWritable>1</mustBeWritable> <mustBeWritable>1</mustBeWritable>
@ -393,8 +429,8 @@
</booleanParameter> </booleanParameter>
</parameterList> </parameterList>
</parameterGroup> </parameterGroup>
<labelParameter name="reinstall" description="Re-install current version"> <labelParameter name="reinstall" description="Upgrade current version">
<title>Re-install</title> <title>Upgrade</title>
<explanation></explanation> <explanation></explanation>
<image></image> <image></image>
</labelParameter> </labelParameter>

38
assets/BitRock Installer Files/IgaunaApp-OSX.xml

@ -96,7 +96,29 @@
</runProgram> </runProgram>
<deleteFile> <deleteFile>
<explanation>Deleting user data</explanation> <explanation>Deleting user data</explanation>
<path>${user_home_directory}/Library/Application Support/Iguana</path> <path>${user_home_directory}/Library/Application Support/Agama</path>
<progressText>Deleting user data</progressText>
<ruleList>
<compareValues>
<logic>equals</logic>
<value1>${previous_installation_exists}</value1>
<value2>1</value2>
</compareValues>
<compareValues>
<logic>equals</logic>
<value1>${installation_type}</value1>
<value2>uninstall</value2>
</compareValues>
<compareValues>
<logic>equals</logic>
<value1>${delete_user_data}</value1>
<value2>1</value2>
</compareValues>
</ruleList>
</deleteFile>
<deleteFile>
<explanation>Deleting user data</explanation>
<path>${user_home_directory}/Library/Application Support/iguana</path>
<progressText>Deleting user data</progressText> <progressText>Deleting user data</progressText>
<ruleList> <ruleList>
<compareValues> <compareValues>
@ -154,6 +176,16 @@
</compareValues> </compareValues>
</ruleList> </ruleList>
</exit> </exit>
<deleteFile>
<explanation>Deleting user data</explanation>
<path>${user_home_directory}/Library/Application Support/iguana/shepherd</path>
<progressText>Deleting user data</progressText>
</deleteFile>
<deleteFile>
<explanation>Deleting user data</explanation>
<path>${user_home_directory}/Library/Application Support/iguana/config.json</path>
<progressText>Deleting user data</progressText>
</deleteFile>
<createDirectory> <createDirectory>
<abortOnError>0</abortOnError> <abortOnError>0</abortOnError>
<explanation>Creating ZcashParam directory</explanation> <explanation>Creating ZcashParam directory</explanation>
@ -304,8 +336,8 @@
</booleanParameter> </booleanParameter>
</parameterList> </parameterList>
</parameterGroup> </parameterGroup>
<labelParameter name="reinstall" description="Re-install current version"> <labelParameter name="reinstall" description="Upgrade current version">
<title>Re-install</title> <title>Upgrade</title>
<explanation></explanation> <explanation></explanation>
<image></image> <image></image>
</labelParameter> </labelParameter>

36
assets/BitRock Installer Files/IgaunaApp-Win.xml

@ -217,6 +217,28 @@
</compareValues> </compareValues>
</ruleList> </ruleList>
</deleteFile> </deleteFile>
<deleteFile>
<explanation>Deleting user data</explanation>
<path>${windows_folder_appdata}/Iguana</path>
<progressText>Deleting user data</progressText>
<ruleList>
<compareValues>
<logic>equals</logic>
<value1>${previous_installation_exists}</value1>
<value2>1</value2>
</compareValues>
<compareValues>
<logic>equals</logic>
<value1>${installation_type}</value1>
<value2>uninstall</value2>
</compareValues>
<compareValues>
<logic>equals</logic>
<value1>${delete_user_data}</value1>
<value2>1</value2>
</compareValues>
</ruleList>
</deleteFile>
<deleteFile> <deleteFile>
<explanation>Deleting zcash params</explanation> <explanation>Deleting zcash params</explanation>
<path>${windows_folder_appdata}/ZcashParams/</path> <path>${windows_folder_appdata}/ZcashParams/</path>
@ -255,6 +277,16 @@
</compareValues> </compareValues>
</ruleList> </ruleList>
</exit> </exit>
<deleteFile>
<explanation>Deleting user data</explanation>
<path>${windows_folder_appdata}/Iguana/shepherd</path>
<progressText>Deleting user data</progressText>
</deleteFile>
<deleteFile>
<explanation>Deleting user data</explanation>
<path>${windows_folder_appdata}/Iguana/config.json</path>
<progressText>Deleting user data</progressText>
</deleteFile>
<showProgressDialog> <showProgressDialog>
<title>Downloading files</title> <title>Downloading files</title>
<actionList> <actionList>
@ -494,8 +526,8 @@
</booleanParameter> </booleanParameter>
</parameterList> </parameterList>
</parameterGroup> </parameterGroup>
<labelParameter name="reinstall" description="Re-install current version"> <labelParameter name="reinstall" description="Upgrade current version">
<title>Re-install</title> <title>Upgrade</title>
<explanation></explanation> <explanation></explanation>
<image></image> <image></image>
</labelParameter> </labelParameter>

1
buildscripts/easydex-build.sh

@ -14,7 +14,6 @@ git pull origin redux
[ -d react ] && cd react || echo "!!! I can't find react" [ -d react ] && cd react || echo "!!! I can't find react"
echo "Actual directory is: ${PWD}" echo "Actual directory is: ${PWD}"
echo "Installing nodejs modules." echo "Installing nodejs modules."
npm install npm install
npm install webpack npm install webpack

2
gui/EasyDEX-GUI

@ -1 +1 @@
Subproject commit 490ddb48a4472dfd9abf8792674a83688fdae0d3 Subproject commit 72c3a472674774be19dbd4a512b44e2fbc41d34d

6
main.js

@ -298,10 +298,14 @@ function createWindow (status) {
if (appConfig.edexGuiOnly) { if (appConfig.edexGuiOnly) {
if (appConfig.v2) { if (appConfig.v2) {
shepherd.writeLog('show edex gui'); shepherd.writeLog('show edex gui');
//mainWindow.loadURL('http://127.0.0.1:3000');
mainWindow.appConfig = appConfig; mainWindow.appConfig = appConfig;
mainWindow.appSessionHash = appSessionHash; mainWindow.appSessionHash = appSessionHash;
if (appConfig.dev) {
mainWindow.loadURL('http://127.0.0.1:3000');
} else {
mainWindow.loadURL('http://' + appConfig.host + ':' + appConfig.agamaPort + '/gui/EasyDEX-GUI/react/build'); mainWindow.loadURL('http://' + appConfig.host + ':' + appConfig.agamaPort + '/gui/EasyDEX-GUI/react/build');
}
} else { } else {
shepherd.writeLog('show edex gui'); shepherd.writeLog('show edex gui');
mainWindow.loadURL('http://' + appConfig.host + ':' + appConfig.agamaPort + '/gui/EasyDEX-GUI/'); mainWindow.loadURL('http://' + appConfig.host + ':' + appConfig.agamaPort + '/gui/EasyDEX-GUI/');

10
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] = {};
outObj.basilisk[coin][address][key].data = JSON.parse(body); outObj.basilisk[coin][address][key].data = JSON.parse(body);
outObj.basilisk[coin][address][key].timestamp = Date.now(); // add timestamp outObj.basilisk[coin][address][key].timestamp = Date.now(); // add timestamp

44
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 * type: POST
* params: payload * params: payload

Loading…
Cancel
Save