diff --git a/.gitignore b/.gitignore index a8ce684..6291be8 100644 --- a/.gitignore +++ b/.gitignore @@ -47,11 +47,5 @@ genesis DB coins -# Ignore all EasyDEX-GUI subfolder files, except README -EasyDEX-GUI -Iguana-GUI -#EasyDEX-GUI/* -#!EasyDEX-GUI/README - # Electron-builder related folders -build \ No newline at end of file +build diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7b43926 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "gui/EasyDEX-GUI"] + path = gui/EasyDEX-GUI + url = https://github.com/SuperNETorg/EasyDEX-GUI.git diff --git a/README.md b/README.md index 2cf89d3..aaf99dc 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,9 @@ Desktop App for SuperNET DAPPs #### For Developers You must have `node.js` and `npm` installed on your machine. -Clone Iguana Desktop App +Clone Iguana Desktop App with EasyDEX-GUI submodule ```shell -git clone https://github.com/SuperNETorg/iguana.git -``` - -Please clone EasyDEX-GUI from github repo here. -```shell -cd gui -git clone https://github.com/SuperNETorg/EasyDEX-GUI.git +git clone --recursive https://github.com/SuperNETorg/iguana.git ``` Install Iguana App diff --git a/assets/bin/osx/iguana b/assets/bin/osx/iguana index 63c2c8b..4e175d9 100755 Binary files a/assets/bin/osx/iguana and b/assets/bin/osx/iguana differ diff --git a/assets/bin/osx/komodo-cli b/assets/bin/osx/komodo-cli index cb2af22..4bc3522 100755 Binary files a/assets/bin/osx/komodo-cli and b/assets/bin/osx/komodo-cli differ diff --git a/assets/bin/osx/komodod b/assets/bin/osx/komodod index 8a39571..f0348c9 100755 Binary files a/assets/bin/osx/komodod and b/assets/bin/osx/komodod differ diff --git a/assets/bin/win64/iguana.exe b/assets/bin/win64/iguana.exe old mode 100755 new mode 100644 index eb82520..0bb78f8 Binary files a/assets/bin/win64/iguana.exe and b/assets/bin/win64/iguana.exe differ diff --git a/assets/bin/win64/libcrypto-1_1.dll b/assets/bin/win64/libcrypto-1_1.dll new file mode 100644 index 0000000..4b16b67 Binary files /dev/null and b/assets/bin/win64/libcrypto-1_1.dll differ diff --git a/assets/bin/win64/libcurl-4.dll b/assets/bin/win64/libcurl-4.dll new file mode 100755 index 0000000..6a73485 Binary files /dev/null and b/assets/bin/win64/libcurl-4.dll differ diff --git a/assets/bin/win64/libcurl.dll b/assets/bin/win64/libcurl.dll new file mode 100644 index 0000000..8c80e23 Binary files /dev/null and b/assets/bin/win64/libcurl.dll differ diff --git a/assets/bin/win64/libgcc_s_sjlj-1.dll b/assets/bin/win64/libgcc_s_sjlj-1.dll new file mode 100755 index 0000000..5f5b6a7 Binary files /dev/null and b/assets/bin/win64/libgcc_s_sjlj-1.dll differ diff --git a/assets/bin/win64/libnanomsg.dll b/assets/bin/win64/libnanomsg.dll new file mode 100755 index 0000000..5d5dc7e Binary files /dev/null and b/assets/bin/win64/libnanomsg.dll differ diff --git a/assets/bin/win64/libssl-1_1.dll b/assets/bin/win64/libssl-1_1.dll new file mode 100644 index 0000000..dee3878 Binary files /dev/null and b/assets/bin/win64/libssl-1_1.dll differ diff --git a/assets/bin/win64/libwinpthread-1.dll b/assets/bin/win64/libwinpthread-1.dll new file mode 100755 index 0000000..67b9289 Binary files /dev/null and b/assets/bin/win64/libwinpthread-1.dll differ diff --git a/assets/bin/win64/nanomsg.dll b/assets/bin/win64/nanomsg.dll old mode 100755 new mode 100644 diff --git a/assets/bin/win64/pthreadvc2.dll b/assets/bin/win64/pthreadvc2.dll old mode 100755 new mode 100644 diff --git a/check_submodule.sh b/check_submodule.sh new file mode 100755 index 0000000..50c17eb --- /dev/null +++ b/check_submodule.sh @@ -0,0 +1,14 @@ +#!/bin/bash +### Script will check EasyDEX-GUI submodule in gui folder. +### If you used git clone without --recursive option this is way to go. + +PWD=`pwd` +SIZE=`du -sk gui/EasyDEX-GUI` + +echo "Checking EasyDEX-GUI folder." +cd gui/EasyDEX-GUI && \ +git submodule update --init --recursive && \ +cd ../.. && \ +echo "Folder looks fine." || \ +echo "Some problem with cloning submodule EasyDEX-GUI." +echo diff --git a/gui/EasyDEX-GUI b/gui/EasyDEX-GUI new file mode 160000 index 0000000..597a06d --- /dev/null +++ b/gui/EasyDEX-GUI @@ -0,0 +1 @@ +Subproject commit 597a06dd1376289aedeaf622ba1dd571e07088c6 diff --git a/pull-gui.sh b/pull-gui.sh deleted file mode 100755 index 2d9bdbd..0000000 --- a/pull-gui.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash -if [ -d "tmp" ]; then - cd tmp -else - mkdir tmp - cd tmp -fi - -if [ -d "EasyDEX-GUI" ]; then - cd EasyDEX-GUI - git pull - cd ../ -else - git clone https://github.com/SuperNETorg/EasyDEX-GUI.git -fi - -#if [ -d "Iguana-application" ]; then -# cd Iguana-application -# git checkout 0.3.1 -# git pull -#else -# git clone https://github.com/SuperNETorg/Iguana-application.git -b 0.3.1 -# cd Iguana-application -#fi - -#bower install -#npm install -#gulp electron - -cd ../../ - -rm "gui/EasyDEX-GUI" -rf -#rm "gui/Iguana-GUI" -rf - -#cp -rf "tmp/Iguana-application/compiled/prod" "gui/Iguana-GUI" -cp -rf "tmp/EasyDEX-GUI" "gui/EasyDEX-GUI" \ No newline at end of file diff --git a/routes/shepherd.js b/routes/shepherd.js index c5e3e2f..a162c9a 100644 --- a/routes/shepherd.js +++ b/routes/shepherd.js @@ -10,6 +10,7 @@ const electron = require('electron'), mkdirp = require('mkdirp'), express = require('express'), exec = require('child_process').exec, + spawn = require('child_process').spawn, md5 = require('md5'), pm2 = require('pm2'), request = require('request'), @@ -1162,7 +1163,13 @@ shepherd.post('/setconf', function(req, res) { console.log(req.body); //console.log(req.body.chain); - setConf(req.body.chain); + if (os.platform() === 'win32' && req.body.chain == 'komodod') { + setkomodoconf = spawn(path.join(__dirname, '../assets/bin/win64/genkmdconf.bat')); + } else { + setConf(req.body.chain); + } + + var obj = { 'msg': 'success', 'result': 'result' @@ -1280,7 +1287,7 @@ shepherd.get('/kick', function(req, res, next) { { 'name': 'tmp/[coin]', 'type': 'folder' - } + } ] }; @@ -1293,13 +1300,13 @@ shepherd.get('/kick', function(req, res, next) { 'result': 'kickstart: brutal is executed' }; - res.end(JSON.stringify(successObj)); + res.end(JSON.stringify(successObj)); } } } if (fs.existsSync(iguanaDir + '/config.json')) { - } + } }); shepherd.loadLocalConfig = function() { @@ -1619,12 +1626,21 @@ function setConf(flock) { switch (flock) { case 'komodod': var DaemonConfPath = komodoDir + '/komodo.conf'; + if (os.platform() === 'win32') { + DaemonConfPath = path.normalize(DaemonConfPath); + } break; case 'zcashd': var DaemonConfPath = ZcashDir + '/zcash.conf'; + if (os.platform() === 'win32') { + DaemonConfPath = path.normalize(DaemonConfPath); + } break; default: var DaemonConfPath = komodoDir + '/' + flock + '/' + flock + '.conf'; + if (os.platform() === 'win32') { + DaemonConfPath = path.normalize(DaemonConfPath); + } } console.log(DaemonConfPath); @@ -1824,26 +1840,42 @@ function getConf(flock) { console.log(flock); - if (os.platform() === 'darwin') { - komodoDir = process.env.HOME + '/Library/Application Support/Komodo', - ZcashDir = process.env.HOME + '/Library/Application Support/Zcash'; - } + if (os.platform() === 'darwin') { + komodoDir = process.env.HOME + '/Library/Application Support/Komodo'; + ZcashDir = process.env.HOME + '/Library/Application Support/Zcash'; + } - if (os.platform() === 'linux') { - komodoDir = process.env.HOME + '/.komodo', - ZcashDir = process.env.HOME + '/.zcash'; - } + if (os.platform() === 'linux') { + komodoDir = process.env.HOME + '/.komodo'; + ZcashDir = process.env.HOME + '/.zcash'; + } - switch (flock) { - case 'komodod': - DaemonConfPath = komodoDir; - break; - case 'zcashd': - DaemonConfPath = ZcashDir; - break; - default: - DaemonConfPath = komodoDir + '/' + flock; - } + if (os.platform() === 'win32') { + komodoDir = process.env.APPDATA + '/Komodo'; + ZcashDir = process.env.APPDATA + '/Zcash'; + } + + switch (flock) { + case 'komodod': + DaemonConfPath = komodoDir; + if (os.platform() === 'win32') { + DaemonConfPath = path.normalize(DaemonConfPath); + console.log('===>>> SHEPHERD API OUTPUT ===>>>'); + console.log(DaemonConfPath); + } + break; + case 'zcashd': + DaemonConfPath = ZcashDir; + if (os.platform() === 'win32') { + DaemonConfPath = path.normalize(DaemonConfPath); + } + break; + default: + DaemonConfPath = komodoDir + '/' + flock; + if (os.platform() === 'win32') { + DaemonConfPath = path.normalize(DaemonConfPath); + } + } console.log(DaemonConfPath); return DaemonConfPath; @@ -1852,7 +1884,7 @@ function getConf(flock) { function formatBytes(bytes, decimals) { if (bytes == 0) return '0 Bytes'; - + var k = 1000, dm = decimals + 1 || 3, sizes = [ @@ -1867,7 +1899,7 @@ function formatBytes(bytes, decimals) { 'YB' ], i = Math.floor(Math.log(bytes) / Math.log(k)); - + return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]; }