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. 3
      buildscripts/easydex-build.sh
  6. 2
      gui/EasyDEX-GUI
  7. 8
      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
```
### 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.

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

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

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

@ -96,7 +96,29 @@
</runProgram>
<deleteFile>
<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>
<ruleList>
<compareValues>
@ -154,6 +176,16 @@
</compareValues>
</ruleList>
</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>
<abortOnError>0</abortOnError>
<explanation>Creating ZcashParam directory</explanation>
@ -304,8 +336,8 @@
</booleanParameter>
</parameterList>
</parameterGroup>
<labelParameter name="reinstall" description="Re-install current version">
<title>Re-install</title>
<labelParameter name="reinstall" description="Upgrade current version">
<title>Upgrade</title>
<explanation></explanation>
<image></image>
</labelParameter>

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

@ -217,6 +217,28 @@
</compareValues>
</ruleList>
</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>
<explanation>Deleting zcash params</explanation>
<path>${windows_folder_appdata}/ZcashParams/</path>
@ -255,6 +277,16 @@
</compareValues>
</ruleList>
</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>
<title>Downloading files</title>
<actionList>
@ -494,8 +526,8 @@
</booleanParameter>
</parameterList>
</parameterGroup>
<labelParameter name="reinstall" description="Re-install current version">
<title>Re-install</title>
<labelParameter name="reinstall" description="Upgrade current version">
<title>Upgrade</title>
<explanation></explanation>
<image></image>
</labelParameter>

3
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!"
echo "EasyDEX-GUI is built!"

2
gui/EasyDEX-GUI

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

8
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/');

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].data = JSON.parse(body);
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
* params: payload

Loading…
Cancel
Save