mirror of https://github.com/lukechilds/Agama.git
pbca26
8 years ago
16 changed files with 41 additions and 471 deletions
@ -1 +1 @@ |
|||||
Subproject commit ba50df3108aa7c3dc27583f15e4f85d80ac08cda |
Subproject commit 7399c05db6464596edf4c242f5a3a57445c70ded |
Before Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 41 KiB |
File diff suppressed because one or more lines are too long
@ -1,52 +0,0 @@ |
|||||
$(document).ready(function() { |
|
||||
const remote = require('electron').remote; |
|
||||
var window = remote.getCurrentWindow(); |
|
||||
var appConf = remote.getCurrentWindow().appConfig; |
|
||||
|
|
||||
$('#pulse').jRoll({ |
|
||||
radius: 100, |
|
||||
animation: 'pulse' |
|
||||
}); |
|
||||
|
|
||||
inititalWalletLoading(); |
|
||||
|
|
||||
$('#loading_status_text').text('Starting Wallet. Please wait...'); |
|
||||
|
|
||||
function inititalWalletLoading() { |
|
||||
// run iguana-less mode with no daemons startup
|
|
||||
if (appConf && appConf.iguanaLessMode) { |
|
||||
// do something
|
|
||||
} else { // run normal mode with 2 iguana instances started prior loading GUI
|
|
||||
if (appConf && !appConf.manualIguanaStart) { |
|
||||
StartIguana(); |
|
||||
} |
|
||||
|
|
||||
var portcheck; |
|
||||
|
|
||||
function startcheck() { |
|
||||
portcheck = setInterval(function(){ |
|
||||
Iguana_activehandle(appConf).then(function(result){ |
|
||||
console.log(result); |
|
||||
|
|
||||
if (result !== 'error') { |
|
||||
stopcheck(); |
|
||||
|
|
||||
if (appConf && appConf.useBasiliskInstance) { |
|
||||
StartIguana_Cache(); |
|
||||
} |
|
||||
|
|
||||
$('#loading_status_text').text('Connecting to Basilisk Network...'); |
|
||||
EDEX_DEXgetinfoAll(appConf.skipBasiliskNetworkCheck, appConf.minNotaries, appConf); |
|
||||
} |
|
||||
}) |
|
||||
}, 2000); |
|
||||
} |
|
||||
|
|
||||
function stopcheck() { |
|
||||
clearInterval(portcheck); |
|
||||
} |
|
||||
|
|
||||
startcheck(); |
|
||||
} |
|
||||
} |
|
||||
}); |
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,108 +0,0 @@ |
|||||
body { |
|
||||
overflow: hidden !important; |
|
||||
border: solid 1px #ccc; |
|
||||
height: 300px; |
|
||||
} |
|
||||
|
|
||||
.text-center { |
|
||||
text-align: center; |
|
||||
} |
|
||||
|
|
||||
.loader-block { |
|
||||
height: 240px; |
|
||||
width: 100%; |
|
||||
position: absolute; |
|
||||
top: -30px; |
|
||||
bottom: 0; |
|
||||
left: 0; |
|
||||
right: 0; |
|
||||
margin: auto; |
|
||||
} |
|
||||
|
|
||||
.pulse-loader { |
|
||||
position: absolute; |
|
||||
top: 10px; |
|
||||
left: -100px; |
|
||||
margin: 80px 50px; |
|
||||
width: 400px !important; |
|
||||
} |
|
||||
|
|
||||
body.agamaMode { |
|
||||
background-color: rgba(33, 33, 33, 0.85); |
|
||||
padding-top: 40px; |
|
||||
color: #fff; |
|
||||
} |
|
||||
|
|
||||
.agama-logo { |
|
||||
padding-bottom: 20px; |
|
||||
} |
|
||||
|
|
||||
#agamaModeStatus { |
|
||||
padding-bottom: 25px; |
|
||||
font-weight: bold; |
|
||||
font-size: 16px; |
|
||||
} |
|
||||
|
|
||||
.btn-primary.focus, |
|
||||
.btn-primary:focus, |
|
||||
.btn-primary:hover, |
|
||||
.btn-primary:active, |
|
||||
.btn-primary.active { |
|
||||
background-color: #ffa726 !important; |
|
||||
border-color: #ffa726 !important; |
|
||||
} |
|
||||
|
|
||||
.btn.active.focus, |
|
||||
.btn.active:focus, |
|
||||
.btn.focus, |
|
||||
.btn:active.focus, |
|
||||
.btn:active:focus, |
|
||||
.btn:focus { |
|
||||
outline: thin dotted; |
|
||||
outline: 5px auto -webkit-focus-ring-color; |
|
||||
outline-offset: -2px; |
|
||||
} |
|
||||
.btn { |
|
||||
padding: 6px 15px; |
|
||||
font-size: 14px; |
|
||||
line-height: 1.57142857; |
|
||||
border-radius: 3px; |
|
||||
-webkit-box-shadow: 0 1px 4px 0 rgba(0,0,0,.1); |
|
||||
box-shadow: 0 1px 4px 0 rgba(0,0,0,.1); |
|
||||
-webkit-transition: border .2s linear,color .2s linear,width .2s linear,background-color .2s linear; |
|
||||
-o-transition: border .2s linear,color .2s linear,width .2s linear,background-color .2s linear; |
|
||||
transition: border .2s linear,color .2s linear,width .2s linear,background-color .2s linear; |
|
||||
-webkit-font-smoothing: subpixel-antialiased; |
|
||||
font-weight: bold; |
|
||||
display: inline-block; |
|
||||
padding: 6px 15px; |
|
||||
margin-bottom: 0; |
|
||||
line-height: 1.57142857; |
|
||||
text-align: center; |
|
||||
white-space: nowrap; |
|
||||
vertical-align: middle; |
|
||||
-ms-touch-action: manipulation; |
|
||||
touch-action: manipulation; |
|
||||
cursor: pointer; |
|
||||
-webkit-user-select: none; |
|
||||
-moz-user-select: none; |
|
||||
-ms-user-select: none; |
|
||||
user-select: none; |
|
||||
background-image: none; |
|
||||
border: 1px solid transparent; |
|
||||
border-radius: 3px; |
|
||||
} |
|
||||
|
|
||||
.btn-primary { |
|
||||
color: #fff; |
|
||||
background-color: #FF6600; |
|
||||
border-color: #FF6600; |
|
||||
} |
|
||||
|
|
||||
.btn:first-child { |
|
||||
margin-right: 20px; |
|
||||
} |
|
||||
|
|
||||
.btn:last-child { |
|
||||
margin-left: 20px; |
|
||||
} |
|
@ -1,215 +0,0 @@ |
|||||
function closeMainWindow() { |
|
||||
const remote = require('electron').remote; |
|
||||
const window = remote.getCurrentWindow(); |
|
||||
|
|
||||
window.createWindow('open'); |
|
||||
window.hide(); |
|
||||
} |
|
||||
|
|
||||
function normalStart() { |
|
||||
const remote = require('electron').remote; |
|
||||
let appConf = remote.getCurrentWindow().appConfig; |
|
||||
appConf.iguanaLessMode = false; |
|
||||
|
|
||||
// run iguana-less mode with no daemons startup
|
|
||||
if (appConf && appConf.iguanaLessMode) { |
|
||||
// do something
|
|
||||
} else { // run normal mode with 2 iguana instances started prior loading GUI
|
|
||||
if (appConf && !appConf.manualIguanaStart) { |
|
||||
StartIguana(); |
|
||||
} |
|
||||
|
|
||||
var portcheck; |
|
||||
|
|
||||
function startcheck() { |
|
||||
portcheck = setInterval(function() { |
|
||||
Iguana_activehandle(appConf).then(function(result){ |
|
||||
console.log(result); |
|
||||
|
|
||||
if (result !== 'error') { |
|
||||
stopcheck(); |
|
||||
|
|
||||
if (appConf && appConf.useBasiliskInstance) { |
|
||||
StartIguana_Cache(); |
|
||||
} |
|
||||
|
|
||||
$('#loading_status_text').text('Connecting to Basilisk Network...'); |
|
||||
EDEX_DEXgetinfoAll(appConf.skipBasiliskNetworkCheck, appConf.minNotaries, appConf); |
|
||||
} |
|
||||
}) |
|
||||
}, 2000); |
|
||||
} |
|
||||
|
|
||||
function stopcheck() { |
|
||||
clearInterval(portcheck); |
|
||||
} |
|
||||
|
|
||||
startcheck(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
function IguanaAJAX(url, ajax_data, timeout) { |
|
||||
return $.ajax({ |
|
||||
data: JSON.stringify(ajax_data), |
|
||||
url: url, |
|
||||
type: 'POST', |
|
||||
dataType: 'json', |
|
||||
timeout: timeout ? timeout : 120000 |
|
||||
//beforeSend: showLoadingImgFn
|
|
||||
}) |
|
||||
.fail(function(xhr, textStatus, error) { |
|
||||
// handle request failures
|
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
function Iguana_activehandle(appConf) { |
|
||||
return new Promise((resolve) => { |
|
||||
var ajax_data = { |
|
||||
'agent': 'SuperNET', |
|
||||
'method': 'activehandle' |
|
||||
}, |
|
||||
AjaxOutputData = IguanaAJAX('http://127.0.0.1:' + appConf.iguanaCorePort, ajax_data).done(function(data) { |
|
||||
//$('#loading_status_text').text('Retrieving active handle...');
|
|
||||
//console.log(AjaxOutputData.responseText);
|
|
||||
AjaxOutputData = JSON.parse(AjaxOutputData.responseText) |
|
||||
//console.log(AjaxOutputData);
|
|
||||
resolve(AjaxOutputData); |
|
||||
}) |
|
||||
.fail(function(xhr, textStatus, error) { |
|
||||
// $('#loading_status_text').text('Retrieving active handle error!');
|
|
||||
// handle request failures
|
|
||||
console.log(xhr.statusText); |
|
||||
if ( xhr.readyState == 0 ) { |
|
||||
} |
|
||||
console.log(textStatus); |
|
||||
console.log(error); |
|
||||
}); |
|
||||
}); |
|
||||
} |
|
||||
//Iguana_activehandle().then(function(result){
|
|
||||
//console.log(result)
|
|
||||
//})
|
|
||||
|
|
||||
function StartIguana() { |
|
||||
var ajax_data = { 'herd': 'iguana'}; |
|
||||
|
|
||||
console.log(ajax_data); |
|
||||
$('#agamaModeStatus').text('Starting main iguana instance...'); |
|
||||
|
|
||||
$.ajax({ |
|
||||
type: 'POST', |
|
||||
data: JSON.stringify(ajax_data), |
|
||||
url: 'http://127.0.0.1:17777/shepherd/herd', |
|
||||
dataType: 'xml/html/script/json', // expected format for response
|
|
||||
contentType: 'application/json', // send as JSON
|
|
||||
success: function(data, textStatus, jqXHR) { |
|
||||
var AjaxOutputData = JSON.parse(data); |
|
||||
console.log('== ActiveHandle Data OutPut =='); |
|
||||
console.log(AjaxOutputData); |
|
||||
}, |
|
||||
error: function(xhr, textStatus, error) { |
|
||||
console.log(xhr.statusText); |
|
||||
if ( xhr.readyState == 0 ) { |
|
||||
} |
|
||||
console.log(textStatus); |
|
||||
console.log(error); |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
function StartIguana_Cache() { |
|
||||
$('#agamaModeStatus').text('Starting basilisk iguana instance...'); |
|
||||
|
|
||||
var ajax_data = { |
|
||||
'mode': 'basilisk', |
|
||||
'coin': 'all' |
|
||||
}; |
|
||||
var start_iguana_cache= $.ajax({ |
|
||||
type: 'POST', |
|
||||
data: JSON.stringify(ajax_data), |
|
||||
url: 'http://127.0.0.1:17777/shepherd/forks', |
|
||||
contentType: 'application/json', // send as JSON
|
|
||||
}) |
|
||||
start_iguana_cache.done(function(data) { |
|
||||
_data = JSON.parse(data); |
|
||||
console.log(_data.result); |
|
||||
sessionStorage.setItem('IguanaCachePort', _data.result); |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
function EDEX_DEXgetinfoAll(skip, minNotaries, appConf) { |
|
||||
const remote = require('electron').remote; |
|
||||
var window = remote.getCurrentWindow(); |
|
||||
|
|
||||
if (!skip) { |
|
||||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|
||||
ajax_data = { |
|
||||
'userpass': tmpIguanaRPCAuth, |
|
||||
'agent': 'dpow', |
|
||||
'method': 'notarychains' |
|
||||
}, |
|
||||
tmp_index = 0, |
|
||||
tmp_index_failed = 0, |
|
||||
get_dex_notarychains = IguanaAJAX('http://127.0.0.1:' + appConf.iguanaCorePort, ajax_data, 10000).done(function(data) { |
|
||||
get_dex_notarychains = JSON.parse(get_dex_notarychains.responseText); |
|
||||
if (minNotaries > get_dex_notarychains.length) { // if config value exceeds total num of notaries
|
|
||||
minNotaries = get_dex_notarychains.length; |
|
||||
} |
|
||||
get_dex_notarychains = get_dex_notarychains.splice(0, minNotaries); |
|
||||
|
|
||||
$.each(get_dex_notarychains, function( coin_index, coin_value ) { |
|
||||
console.log(coin_index + ': ' + coin_value); |
|
||||
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'), |
|
||||
ajax_data = { |
|
||||
'userpass': tmpIguanaRPCAuth, |
|
||||
'agent': 'dex', |
|
||||
'method': 'getinfo', |
|
||||
'symbol': coin_value |
|
||||
}; |
|
||||
|
|
||||
console.log(ajax_data); |
|
||||
|
|
||||
if (coin_value !== 'MESH' || coin_value !== 'CEAL') { |
|
||||
var getinfo_each_chain = IguanaAJAX('http://127.0.0.1:' + appConf.iguanaCorePort, ajax_data, 10000).done(function(data) { |
|
||||
getinfo_each_chain = JSON.parse(getinfo_each_chain.responseText); |
|
||||
console.log(getinfo_each_chain); |
|
||||
|
|
||||
tmp_index++; |
|
||||
$('#loading_sub_status_text').text('Connection status... ' + tmp_index + '/' + get_dex_notarychains.length + ': ' + coin_value); |
|
||||
|
|
||||
if (getinfo_each_chain.error === 'less than required responses') { |
|
||||
$('#loading_sub_status_output_text').text('Output: ' + getinfo_each_chain.error); |
|
||||
} else { |
|
||||
$('#loading_sub_status_output_text').text('Output: Connected'); |
|
||||
} |
|
||||
|
|
||||
if ( tmp_index + tmp_index_failed === minNotaries ) { |
|
||||
console.log('min notaries connected'); |
|
||||
window.createWindow('open'); |
|
||||
window.hide(); |
|
||||
} |
|
||||
}) |
|
||||
.fail(function(xhr, textStatus, error) { |
|
||||
tmp_index_failed++; |
|
||||
|
|
||||
if ( tmp_index + tmp_index_failed === minNotaries ) { |
|
||||
console.log('min notaries connected'); |
|
||||
window.createWindow('open'); |
|
||||
window.hide(); |
|
||||
} |
|
||||
|
|
||||
// handle request failures
|
|
||||
console.log(xhr.statusText); |
|
||||
if ( xhr.readyState == 0 ) { |
|
||||
} |
|
||||
console.log(textStatus); |
|
||||
console.log(error); |
|
||||
}); |
|
||||
} |
|
||||
}); |
|
||||
}); |
|
||||
} else { |
|
||||
window.createWindow('open'); |
|
||||
window.hide(); |
|
||||
} |
|
||||
} |
|
@ -1,4 +0,0 @@ |
|||||
if (typeof module === 'object') { |
|
||||
window.module = module; |
|
||||
module = undefined; |
|
||||
} |
|
@ -0,0 +1,28 @@ |
|||||
|
cd gui/EasyDEX-GUI/react |
||||
|
echo "building gui..." |
||||
|
rm -rf ./build |
||||
|
mkdir build |
||||
|
mkdir build/assets |
||||
|
cp -R src/assets build/ |
||||
|
./node_modules/.bin/webpack --config ./webpack.prod.config.js |
||||
|
cd ../../../ |
||||
|
echo "copy patch files" |
||||
|
rm -rf ./patch.zip |
||||
|
rm -rf ./patch |
||||
|
mkdir patch |
||||
|
mkdir patch/gui |
||||
|
mkdir patch/gui/EasyDEX-GUI |
||||
|
cp -R gui/EasyDEX-GUI/react/build patch/gui/EasyDEX-GUI/react |
||||
|
cp -R gui/EasyDEX-GUI/assets patch/gui/EasyDEX-GUI |
||||
|
cp gui/index.html patch/gui/index.html |
||||
|
cp ./main.js patch |
||||
|
cp ./version patch |
||||
|
cp -R routes patch/routes |
||||
|
cp -R private patch/private |
||||
|
echo "package patch.zip" |
||||
|
cd patch |
||||
|
zip -r patch.zip gui routes private main.js version |
||||
|
cd ../ |
||||
|
cp patch/patch.zip ./ |
||||
|
rm -rf patch |
||||
|
echo "patch.zip is ready" |
@ -1,2 +1,3 @@ |
|||||
version=0.2.0.2a |
version=0.2.0.21a |
||||
type=e-beta |
type=e-beta |
||||
|
minversion=0.2.0.2 |
Loading…
Reference in new issue