pbca26 8 years ago
parent
commit
2ac1f0507c
  1. 35
      assets/bitrock_installer/AgamaApp-linux.xml
  2. 32
      assets/bitrock_installer/AgamaApp-osx.xml
  3. 39
      assets/bitrock_installer/AgamaApp-windows.xml
  4. 2
      gui/EasyDEX-GUI
  5. 126
      private/kmdcli.js
  6. 37
      routes/shepherd.js

35
assets/bitrock_installer/AgamaApp-linux.xml

@ -1,6 +1,6 @@
<project>
<shortName>AgamaApp</shortName>
<fullName>iguana</fullName>
<fullName>Agama</fullName>
<version>${PKG_VERSION}</version>
<licenseFile>../../LICENSE</licenseFile>
<leftImage>../installer_imgs/Agama_installer_wizard_image.png</leftImage>
@ -172,15 +172,15 @@
</compareValues>
<compareValues>
<logic>equals</logic>
<value1>${keep_settings_and_userdata}</value1>
<value2>0</value2>
<value1>${delete_user_data}</value1>
<value2>1</value2>
</compareValues>
</ruleList>
</deleteFile>
<deleteFile>
<explanation>Deleting zcache-params</explanation>
<path>${user_home_directory}/.zcache-params</path>
<progressText>Deleting zcache-params</progressText>
<explanation>Deleting zcash params</explanation>
<path>${user_home_directory}/.zcash-params</path>
<progressText>Deleting zcash-params</progressText>
<ruleList>
<compareValues>
<logic>equals</logic>
@ -194,8 +194,8 @@
</compareValues>
<compareValues>
<logic>equals</logic>
<value1>${keep_settings_and_userdata}</value1>
<value2>0</value2>
<value1>${delete_zcash_params}</value1>
<value2>1</value2>
</compareValues>
</ruleList>
</deleteFile>
@ -267,6 +267,14 @@
</fileExists>
</ruleList>
</showProgressDialog>
<changePermissions>
<files>${user_home_directory}/.zcash-params</files>
<permissions>777</permissions>
</changePermissions>
<changePermissions>
<files>${user_home_directory}/.zcash-params/*</files>
<permissions>666</permissions>
</changePermissions>
</readyToInstallActionList>
<postInstallationActionList>
<createSymLink>
@ -373,10 +381,15 @@
<value></value>
<default></default>
<parameterList>
<booleanParameter name="keep_settings_and_userdata" description="Keep setting and user data" displayStyle="checkbox-left">
<booleanParameter name="delete_user_data" description="Delete user data" displayStyle="checkbox-left">
<explanation></explanation>
<value>0</value>
<default>0</default>
</booleanParameter>
<booleanParameter name="delete_zcash_params" description="Delete Zcash params" displayStyle="checkbox-left">
<explanation></explanation>
<value>1</value>
<default>1</default>
<value>0</value>
<default>0</default>
</booleanParameter>
</parameterList>
</parameterGroup>

32
assets/bitrock_installer/AgamaApp-osx.xml

@ -1,6 +1,6 @@
<project>
<shortName>AgamaApp</shortName>
<fullName>iguana</fullName>
<fullName>Agama</fullName>
<version>${PKG_VERSION}</version>
<licenseFile>../../LICENSE</licenseFile>
<leftImage>../installer_imgs/Agama_installer_wizard_image.png</leftImage>
@ -85,7 +85,7 @@
<readyToInstallActionList>
<runProgram>
<program>open</program>
<programArguments>${oldInstalldir}/Agama.app/${uninstallerName}.app</programArguments>
<programArguments>-W ${oldInstalldir}/Agama.app/${uninstallerName}.app</programArguments>
<ruleList>
<compareValues>
<logic>equals</logic>
@ -111,8 +111,8 @@
</compareValues>
<compareValues>
<logic>equals</logic>
<value1>${keep_settings_and_userdata}</value1>
<value2>0</value2>
<value1>${delete_user_data}</value1>
<value2>1</value2>
</compareValues>
</ruleList>
</deleteFile>
@ -133,8 +133,8 @@
</compareValues>
<compareValues>
<logic>equals</logic>
<value1>${keep_settings_and_userdata}</value1>
<value2>0</value2>
<value1>${delete_zcash_params}</value1>
<value2>1</value2>
</compareValues>
</ruleList>
</deleteFile>
@ -206,6 +206,14 @@
</fileExists>
</ruleList>
</showProgressDialog>
<changePermissions>
<files>${user_home_directory}/Library/Application Support/ZcashParams</files>
<permissions>777</permissions>
</changePermissions>
<changePermissions>
<files>${user_home_directory}/Library/Application Support/ZcashParams/*</files>
<permissions>666</permissions>
</changePermissions>
</readyToInstallActionList>
<postInstallationActionList>
<!-- Store values of current installer in etc folder so we can find for uninstal -->
@ -240,6 +248,7 @@
<program>open</program>
<programArguments>/Applications/Agama.app</programArguments>
<progressText>Do you want to launch ${project.fullName} now?</progressText>
<runAs>$USER</runAs>
</runProgram>
</finalPageActionList>
<parameterList>
@ -283,10 +292,15 @@
<value></value>
<default></default>
<parameterList>
<booleanParameter name="keep_settings_and_userdata" description="Keep setting and user data" displayStyle="checkbox-left">
<booleanParameter name="delete_user_data" description="Delete user data" displayStyle="checkbox-left">
<explanation></explanation>
<value>0</value>
<default>0</default>
</booleanParameter>
<booleanParameter name="delete_zcash_params" description="Delete Zcash params" displayStyle="checkbox-left">
<explanation></explanation>
<value>1</value>
<default>1</default>
<value>0</value>
<default>0</default>
</booleanParameter>
</parameterList>
</parameterGroup>

39
assets/bitrock_installer/AgamaApp-windows.xml

@ -1,6 +1,6 @@
<project>
<shortName>AgamaApp</shortName>
<fullName>iguana</fullName>
<fullName>Agama</fullName>
<version>${PKG_VERSION}</version>
<licenseFile>../../LICENSE</licenseFile>
<leftImage>../installer_imgs/Agama_installer_wizard_image.png</leftImage>
@ -212,8 +212,30 @@
</compareValues>
<compareValues>
<logic>equals</logic>
<value1>${keep_settings_and_userdata}</value1>
<value2>0</value2>
<value1>${delete_user_data}</value1>
<value2>1</value2>
</compareValues>
</ruleList>
</deleteFile>
<deleteFile>
<explanation>Deleting zcash params</explanation>
<path>${windows_folder_appdata}/ZcashParams/</path>
<progressText>Deleting zcash-params</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_zcash_params}</value1>
<value2>1</value2>
</compareValues>
</ruleList>
</deleteFile>
@ -460,10 +482,15 @@
<value></value>
<default></default>
<parameterList>
<booleanParameter name="keep_settings_and_userdata" description="Keep setting and user data" displayStyle="checkbox-left">
<booleanParameter name="delete_user_data" description="Delete user data" displayStyle="checkbox-left">
<explanation></explanation>
<value>0</value>
<default>0</default>
</booleanParameter>
<booleanParameter name="delete_zcash_params" description="Delete Zcash params" displayStyle="checkbox-left">
<explanation></explanation>
<value>1</value>
<default>1</default>
<value>0</value>
<default>0</default>
</booleanParameter>
</parameterList>
</parameterGroup>

2
gui/EasyDEX-GUI

@ -1 +1 @@
Subproject commit f7474a7affd6c5c0f63960db3bd5f6d325ed50a4
Subproject commit ae14c3c51e05da3848e0c18c432f153dab898df5

126
private/kmdcli.js

@ -0,0 +1,126 @@
/*
* Copyright (c) 2015 Satinderjit Singh
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
/*
* Agama komodo-cli paths
*
*/
var child_process = require('child_process'),
path = require('path'),
os = require('os');
if (os.platform() === 'darwin') {
var komodocliBin = path.join(__dirname, '../assets/bin/osx/komodo-cli'),
zcashcliBin = '/Applications/ZCashSwingWalletUI.app/Contents/MacOS/zcash-cli';
}
if (os.platform() === 'linux') {
var komodocliBin = path.join(__dirname, '../assets/bin/linux64/komodo-cli');
}
if (os.platform() === 'win32') {
var komodocliBin = path.join(__dirname, '../assets/bin/win64/komodo-cli.exe'),
komodocliBin = path.normalize(komodocliBin);
}
console.log(komodocliBin)
/**
* The **komodo-cli** command is used to get komodo api calls answer.
*
* @private
* @category kmdcli
*
*/
var kmdcli = module.exports = {
exec: child_process.exec,
command: command
};
/**
* Parses komodo-cli commands.
*
* @private
* @static
* @category kmdcli
* @param {function} callback The callback function.
*
*/
function parse_kmdcli_commands(callback) {
return function(error, stdout, stderr) {
if (error) callback(error, stderr);
else callback(error, stdout);
//console.log(stdout)
};
}
/**
* Parses komodo-cli commands.
*
* @private
* @static
* @category kmdcli
* @param {function} callback The callback function.
* @example
*
* var kmdcli = require('./kmdcli');
*
* kmdcli.command('getinfo', function(err, command) {
* console.log(command);
* });
*
* // =>
* {
* "version" : 1000550,
* "protocolversion" : 170002,
* "notarized" : 254740,
* "notarizedhash" : "01f4f1c46662ccca2e7fa9e7e38d4d2e4ced4402fa0f4fc116b8f004bb8cf272",
* "notarizedtxid" : "2b16e47a176f8c1886ca0268243f9b96f8b2db466ea26ae99873d5224bbf80b6",
* "walletversion" : 60000,
* "balance" : 32632.46167742,
* "interest" : 0.00478671,
* "blocks" : 254791,
* "longestchain" : 254791,
* "timeoffset" : 0,
* "tiptime" : 1490815616,
* "connections" : 8,
* "proxy" : "",
* "difficulty" : 707836.56791394,
* "testnet" : false,
* "keypoololdest" : 1482746526,
* "keypoolsize" : 101,
* "paytxfee" : 0.00000000,
* "relayfee" : 0.00001000,
* "errors" : "WARNING: check your network connection, 157 blocks received in the last 4 hours (240 expected)",
* "notaryid" : -1,
* "pubkey" : "000000000000000000000000000000000000000000000000000000000000000000"
* }
*
*/
function command(kmd_command, callback) {
if (callback) {
return this.exec(komodocliBin + " " + kmd_command,
parse_kmdcli_commands(callback));
}
}

37
routes/shepherd.js

@ -22,6 +22,7 @@ Promise = require('bluebird');
const fixPath = require('fix-path');
var ps = require('ps-node'),
setconf = require('../private/setconf.js'),
kmdcli = require('../private/kmdcli.js'),
shepherd = express.Router();
// IGUANA FILES AND CONFIG SETTINGS
@ -319,6 +320,42 @@ shepherd.post('/herd', function(req, res) {
res.end(JSON.stringify(obj));
});
/*
*
* ajax_data = { 'command': 'getinfo' };
*
* console.log(ajax_data);
* $.ajax({
* async: false,
* type: 'POST',
* data: JSON.stringify(ajax_data),
* url: 'http://127.0.0.1:17777/shepherd/kmdcli',
* contentType: 'application/json', // send as JSON
* success: function(data, textStatus, jqXHR) {
* var AjaxOutputData = JSON.parse(data);
* console.log(AjaxOutputData);
* },
* error: function(xhr, textStatus, error) {
* console.log(xhr.statusText);
* console.log(textStatus);
* console.log(error);
* }
* });
*
*/
/*shepherd.post('/kmdcli', function(req, res) {
console.log('======= req.body =======');
//console.log(req);
console.log(req.body);
console.log(req.body.command);
kmdcli.command(req.body.command, function(err, command) {
console.log(command);
res.end(JSON.stringify(command));
});
});*/
/*
* type: POST
* params: herdname

Loading…
Cancel
Save