Skip to content

Commit

Permalink
Merge pull request #62 from VerusCoin/dev
Browse files Browse the repository at this point in the history
0.7.1-5
  • Loading branch information
Asherda authored Aug 14, 2020
2 parents 4649280 + 80dbf06 commit abae355
Show file tree
Hide file tree
Showing 35 changed files with 793 additions and 862 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ stages:
variables:
DOCKER_DRIVER: overlay2
DEFAULT_VERUSCOIN_BRANCH: release
VERUS_VERSION: 0.7.1-4
VERUSCOIN_VERSION: 0.7.1-4
VERUS_VERSION: 0.7.1-5
VERUSCOIN_VERSION: 0.7.1-5
KOMODO_VERSION: 0.6.1
BINARY_SOURCE: VerusCoin
VERUS_APPIMAGE_X64: Verus-Desktop-v${VERUS_VERSION}-x86_64.AppImage
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "verus-desktop",
"productName": "Verus-Desktop",
"version": "0.7.1-4",
"version": "0.7.1-5",
"description": "Verus Desktop Wallet App",
"main": "main.js",
"scripts": {
Expand Down Expand Up @@ -143,13 +143,16 @@
}
},
"resolutions": {
"lodash": "^4.17.15",
"lodash": "^4.17.19",
"js-yaml": "^3.13.1",
"tar": "^4.4.8",
"https-proxy-agent": "2.2.4",
"mem": "4.0.0",
"bin-links": "1.1.6",
"yargs-parser": "^13.1.2",
"minimist": "^1.2.5"
"minimist": "^1.2.5",
"elliptic": "^6.5.3",
"dot-prop": "^5.2.0",
"npm-registry-fetch": "^4.0.5"
}
}
6 changes: 3 additions & 3 deletions private/mainmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,19 @@ const template = [
{
label: 'Show Verus Desktop Wallet data folder',
click (item, focusedWindow) {
shell.openItem(pathsAgama().agamaDir);
shell.openItem(pathsAgama().paths.agamaDir);
}
},
{
label: 'Show Verus data folder (default)',
click (item, focusedWindow) {
shell.openItem(pathsDaemons().vrscDir);
shell.openItem(pathsDaemons().paths.vrscDir);
}
},
{
label: 'Show binary folder',
click (item, focusedWindow) {
shell.openItem(pathsDaemons().komodocliDir);
shell.openItem(pathsDaemons().paths.komodocliDir);
}
},
/*{
Expand Down
6 changes: 3 additions & 3 deletions routes/api/addressBook.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = (api) => {
const data = req.body.data;

if (api.checkToken(req.body.token)) {
fs.writeFile(`${api.agamaDir}/shepherd/addressBook.json`, JSON.stringify(data), (err) => {
fs.writeFile(`${api.paths.agamaDir}/shepherd/addressBook.json`, JSON.stringify(data), (err) => {
if (err) {
api.log('error writing address book file', 'addressBook');

Expand Down Expand Up @@ -42,8 +42,8 @@ module.exports = (api) => {
//TODO: Re-evauluate as POST or eliminate use of API token
/*api.get('/addressbook', (req, res, next) => {
if (api.checkToken(req.query.token)) {
if (fs.existsSync(`${api.agamaDir}/shepherd/addressBook.json`)) {
fs.readFile(`${api.agamaDir}/shepherd/addressBook.json`, 'utf8', (err, data) => {
if (fs.existsSync(`${api.paths.agamaDir}/shepherd/addressBook.json`)) {
fs.readFile(`${api.paths.agamaDir}/shepherd/addressBook.json`, 'utf8', (err, data) => {
if (err) {
const retObj = {
msg: 'error',
Expand Down
10 changes: 5 additions & 5 deletions routes/api/appInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ module.exports = (api) => {
const sysInfo = api.SystemInfo();
const releaseInfo = api.appBasicInfo;
const dirs = {
agamaDir: api.agamaDir,
kmdDir: api.kmdDir,
agamaDir: api.paths.agamaDir,
kmdDir: api.paths.kmdDir,
komododBin: api.komododBin,
configLocation: `${api.agamaDir}/config.json`,
cacheLocation: `${api.agamaDir}/spv-cache.json`,
configLocation: `${api.paths.agamaDir}/config.json`,
cacheLocation: `${api.paths.agamaDir}/spv-cache.json`,
};
let spvCacheSize = '2 Bytes';

try {
spvCacheSize = formatBytes(fs.lstatSync(`${api.agamaDir}/spv-cache.json`).size);
spvCacheSize = formatBytes(fs.lstatSync(`${api.paths.agamaDir}/spv-cache.json`).size);
} catch (e) {}

return {
Expand Down
4 changes: 2 additions & 2 deletions routes/api/coindWalletKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ module.exports = (api) => {
const chain = req.query.chain;
// ref: https://gist.github.com/kendricktan/1e62495150ad236b38616d733aac4eb9
let _walletDatLocation = chain === 'komodo' || chain === 'KMD' || chain === 'null' ? `${api.kmdDir}/wallet.dat` : `${api.kmdDir}/${chain}/wallet.dat`;
_walletDatLocation = chain === 'CHIPS' ? `${api.chipsDir}/wallet.dat` : _walletDatLocation;
let _walletDatLocation = chain === 'komodo' || chain === 'KMD' || chain === 'null' ? `${api.paths.kmdDir}/wallet.dat` : `${api.paths.kmdDir}/${chain}/wallet.dat`;
_walletDatLocation = chain === 'CHIPS' ? `${api.paths.chipsDir}/wallet.dat` : _walletDatLocation;
try {
_fs.access(_walletDatLocation, fs.constants.R_OK, (err) => {
Expand Down
10 changes: 5 additions & 5 deletions routes/api/coinsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const fs = require('fs-extra');
module.exports = (api) => {
api.loadCoinsListFromFile = () => {
try {
if (fs.existsSync(`${api.agamaDir}/shepherd/coinslist.json`)) {
const _coinsList = JSON.parse(fs.readFileSync(`${api.agamaDir}/shepherd/coinslist.json`, 'utf8'));
if (fs.existsSync(`${api.paths.agamaDir}/shepherd/coinslist.json`)) {
const _coinsList = JSON.parse(fs.readFileSync(`${api.paths.agamaDir}/shepherd/coinslist.json`, 'utf8'));

for (let i = 0; i < _coinsList.length; i++) {
const _coin = _coinsList[i].selectedCoin.split('|');
Expand All @@ -27,8 +27,8 @@ module.exports = (api) => {
//TODO: Re-evauluate as POST or eliminate use of API token
/*api.get('/coinslist', (req, res, next) => {
if (api.checkToken(req.query.token)) {
if (fs.existsSync(`${api.agamaDir}/shepherd/coinslist.json`)) {
fs.readFile(`${api.agamaDir}/shepherd/coinslist.json`, 'utf8', (err, data) => {
if (fs.existsSync(`${api.paths.agamaDir}/shepherd/coinslist.json`)) {
fs.readFile(`${api.paths.agamaDir}/shepherd/coinslist.json`, 'utf8', (err, data) => {
if (err) {
const retObj = {
msg: 'error',
Expand Down Expand Up @@ -79,7 +79,7 @@ module.exports = (api) => {

res.end(JSON.stringify(retObj));
} else {
fs.writeFile(`${api.agamaDir}/shepherd/coinslist.json`, JSON.stringify(_payload), (err) => {
fs.writeFile(`${api.paths.agamaDir}/shepherd/coinslist.json`, JSON.stringify(_payload), (err) => {
if (err) {
const retObj = {
msg: 'error',
Expand Down
28 changes: 14 additions & 14 deletions routes/api/conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ module.exports = (api) => {
//directory will lie in PBaaS territory, outside of the kmdDir
if (api.appConfig.general.main.reservedChains.indexOf(flock) === -1) {
if (api.appConfig.general.main.pbaasTestmode) {
pbaasCoinDir = path.normalize(path.join(api.verusTestDir, `/PBAAS/${flock}`));
pbaasCoinDir = path.normalize(path.join(api.paths.verusTestDir, `/PBAAS/${flock}`));
api.log(`Assuming PBAAS chain in test mode, using conf path as ${pbaasCoinDir}`, 'native.confd');
} else {
pbaasCoinDir = path.normalize(path.join(api.verusDir, `/PBAAS/${flock}`));
pbaasCoinDir = path.normalize(path.join(api.paths.verusDir, `/PBAAS/${flock}`));
api.log(`Assuming PBAAS chain, using conf path as ${pbaasCoinDir}`, 'native.confd');
}

Expand All @@ -53,7 +53,7 @@ module.exports = (api) => {

switch (flock) {
case 'komodod':
DaemonConfPath = api.kmdDir;
DaemonConfPath = api.paths.kmdDir;
if (_platform === 'win32') {
DaemonConfPath = path.normalize(DaemonConfPath);
api.log('===>>> API OUTPUT ===>>>', 'native.confd');
Expand All @@ -66,7 +66,7 @@ module.exports = (api) => {
}
break;
case 'chipsd':
DaemonConfPath = api.chipsDir;
DaemonConfPath = api.paths.chipsDir;
if (_platform === 'win32') {
DaemonConfPath = path.normalize(DaemonConfPath);
}
Expand All @@ -76,7 +76,7 @@ module.exports = (api) => {
// DaemonConfPath = _platform === 'win32' ? path.normalize(`${api.coindRootDir}/${coind.toLowerCase()}`) : `${api.coindRootDir}/${coind.toLowerCase()}`;
// break;
default:
DaemonConfPath = `${api.kmdDir}/${flock}`;
DaemonConfPath = `${api.paths.kmdDir}/${flock}`;
if (_platform === 'win32') {
DaemonConfPath = path.normalize(DaemonConfPath);
}
Expand Down Expand Up @@ -111,9 +111,9 @@ module.exports = (api) => {
switch (flock) {
case 'verusd':
if (coind && api.appConfig.general.main.reservedChains.indexOf(coind) === -1) {
DaemonConfPath = `${api.verusDir}/PBAAS/${coind}.conf`;
DaemonConfPath = `${api.paths.verusDir}/PBAAS/${coind}.conf`;
} else {
DaemonConfPath = `${api.vrscDir}/VRSC.conf`;
DaemonConfPath = `${api.paths.vrscDir}/VRSC.conf`;
}


Expand All @@ -122,7 +122,7 @@ module.exports = (api) => {
}
break;
case 'komodod':
DaemonConfPath = `${api.kmdDir}/komodo.conf`;
DaemonConfPath = `${api.paths.kmdDir}/komodo.conf`;

if (_platform === 'win32') {
DaemonConfPath = path.normalize(DaemonConfPath);
Expand All @@ -136,7 +136,7 @@ module.exports = (api) => {
}
break;
case 'chipsd':
DaemonConfPath = `${api.chipsDir}/chips.conf`;
DaemonConfPath = `${api.paths.chipsDir}/chips.conf`;

if (_platform === 'win32') {
DaemonConfPath = path.normalize(DaemonConfPath);
Expand All @@ -150,7 +150,7 @@ module.exports = (api) => {
}
break;
default:
DaemonConfPath = `${api.kmdDir}/${flock}/${flock}.conf`;
DaemonConfPath = `${api.paths.kmdDir}/${flock}/${flock}.conf`;

if (_platform === 'win32') {
DaemonConfPath = path.normalize(DaemonConfPath);
Expand Down Expand Up @@ -468,17 +468,17 @@ module.exports = (api) => {

api.setConfKMD = (isChips) => {
// check if kmd conf exists
_fs.access(isChips ? `${api.chipsDir}/chips.conf` : `${api.kmdDir}/komodo.conf`, fs.constants.R_OK, (err) => {
_fs.access(isChips ? `${api.paths.chipsDir}/chips.conf` : `${api.paths.kmdDir}/komodo.conf`, fs.constants.R_OK, (err) => {
if (err) {
api.log(isChips ? 'creating chips conf' : 'creating komodo conf', 'native.confd');
api.writeLog(isChips ? `creating chips conf in ${api.chipsDir}/chips.conf` : `creating komodo conf in ${api.kmdDir}/komodo.conf`);
api.writeLog(isChips ? `creating chips conf in ${api.paths.chipsDir}/chips.conf` : `creating komodo conf in ${api.paths.kmdDir}/komodo.conf`);
setConf(isChips ? 'chipsd' : 'komodod');
} else {
const _confSize = fs.lstatSync(isChips ? `${api.chipsDir}/chips.conf` : `${api.kmdDir}/komodo.conf`);
const _confSize = fs.lstatSync(isChips ? `${api.paths.chipsDir}/chips.conf` : `${api.paths.kmdDir}/komodo.conf`);

if (_confSize.size === 0) {
api.log(isChips ? 'err: chips conf file is empty, creating chips conf' : 'err: komodo conf file is empty, creating komodo conf', 'native.confd');
api.writeLog(isChips ? `creating chips conf in ${api.chipsDir}/chips.conf` : `creating komodo conf in ${api.kmdDir}/komodo.conf`);
api.writeLog(isChips ? `creating chips conf in ${api.paths.chipsDir}/chips.conf` : `creating komodo conf in ${api.paths.kmdDir}/komodo.conf`);
setConf(isChips ? 'chipsd' : 'komodod');
} else {
api.writeLog(isChips ? 'chips conf exists' : 'komodo conf exists');
Expand Down
10 changes: 5 additions & 5 deletions routes/api/confMaxconnections.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const Promise = require('bluebird');
module.exports = (api) => {
api.getMaxconKMDConf = () => {
return new Promise((resolve, reject) => {
fs.readFile(`${api.kmdDir}/komodo.conf`, 'utf8', (err, data) => {
fs.readFile(`${api.paths.kmdDir}/komodo.conf`, 'utf8', (err, data) => {
if (err) {
api.log('kmd conf maxconnections param read failed', 'native.confd');
resolve('unset');
Expand All @@ -25,11 +25,11 @@ module.exports = (api) => {

api.setMaxconKMDConf = (limit) => {
return new Promise((resolve, reject) => {
fs.readFile(`${api.kmdDir}/komodo.conf`, 'utf8', (err, data) => {
fs.readFile(`${api.paths.kmdDir}/komodo.conf`, 'utf8', (err, data) => {
const _maxconVal = limit ? 1 : 10;

if (err) {
api.log(`error reading ${api.kmdDir}/komodo.conf`, 'native.confd');
api.log(`error reading ${api.paths.kmdDir}/komodo.conf`, 'native.confd');
resolve(false);
} else {
if (data.indexOf('maxconnections=') > -1) {
Expand All @@ -40,9 +40,9 @@ module.exports = (api) => {
data = `${data}\nmaxconnections=${_maxconVal}\n`;
}

fs.writeFile(`${api.kmdDir}/komodo.conf`, data, (err) => {
fs.writeFile(`${api.paths.kmdDir}/komodo.conf`, data, (err) => {
if (err) {
api.log(`error writing ${api.kmdDir}/komodo.conf maxconnections=${_maxconVal}`, 'native.confd');
api.log(`error writing ${api.paths.kmdDir}/komodo.conf maxconnections=${_maxconVal}`, 'native.confd');
resolve(false);
} else {
api.log(`kmd conf maxconnections is set to ${_maxconVal}`, 'native.confd');
Expand Down
10 changes: 5 additions & 5 deletions routes/api/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const {

module.exports = (api) => {
api.loadLocalConfig = () => {
const configLocation = `${api.agamaDir}/config.json`
const configLocation = `${api.paths.agamaDir}/config.json`

if (fs.existsSync(configLocation)) {
try {
Expand Down Expand Up @@ -85,11 +85,11 @@ module.exports = (api) => {
};

api.saveLocalAppConf = (appSettings) => {
const configFileName = `${api.agamaDir}/config.json`;
const configFileName = `${api.paths.agamaDir}/config.json`;

try {
try {
_fs.accessSync(api.agamaDir, fs.constants.R_OK)
_fs.accessSync(api.paths.agamaDir, fs.constants.R_OK)
} catch (e) {
if (e.code == 'EACCES') {
fsnode.chmodSync(configFileName, '0666');
Expand All @@ -103,8 +103,8 @@ module.exports = (api) => {


api.log('config.json write file is done', 'settings');
api.log(`app config.json file is created successfully at: ${api.agamaDir}`, 'settings');
api.writeLog(`app config.json file is created successfully at: ${api.agamaDir}`);
api.log(`app config.json file is created successfully at: ${api.paths.agamaDir}`, 'settings');
api.writeLog(`app config.json file is created successfully at: ${api.paths.agamaDir}`);
} catch (e) {
api.log('error writing config', 'settings');
api.log(e, 'settings');
Expand Down
Loading

0 comments on commit abae355

Please sign in to comment.