Browse Source

startup window agama modes explained

v0.25
pbca26 7 years ago
parent
commit
fcd9de9885
  1. 23
      gui/startup/index.html
  2. 12
      routes/shepherd/confMaxconnections.js

23
gui/startup/index.html

@ -19,13 +19,33 @@
onClick="quitApp()">
<img src="../EasyDEX-GUI/assets/mainWindow/img/fa-close.png">
</div>
<div class="intro">
<img
src="../EasyDEX-GUI/assets/mainWindow/img/agama-icon.svg"
class="agama-logo"
alt="Agama Wallet"
width="80"
height="100" />
<div id="agamaModeStatus">Choose Agama mode</div>
<div id="agamaModeStatus">
Choose Agama mode
<div
onClick="toggleMainWindowHelp()"
class="settings-help pointer"
title="About Agama modes">
<img src="../EasyDEX-GUI/assets/mainWindow/img/fa-question.png" />
</div>
</div>
</div>
<div class="agama-modes-help" style="display: none">
<img
onClick="toggleMainWindowHelp()"
class="close-btn"
src="../EasyDEX-GUI/assets/mainWindow/img/fa-close.png">
<strong>Be aware:</strong> Native mode requires to download the whole blockchain data to a local disk before you can start using it. This may take from <strong>several hours to a day</strong> depending on your connection and hardware. Please <u>try to keep Agama running</u> until the whole process is finished.
<br /><br />
If you need a quick and easy access to your funds try SPV mode which doesn't require any blockchain to be loaded locally. All data is requested on demand from Electrum servers.
</div>
<div class="mode-desc native">Full blockchain mode</div>
<button
id="nativeOnlyBtn"
onClick="closeMainWindow(true)"
@ -50,6 +70,7 @@
</li>
</ul>
<div class="mode-desc spv">Starts in seconds</div>
<button
id="spvBtn"
onClick="startSPV('KMD')"

12
routes/shepherd/confMaxconnections.js

@ -1,15 +1,17 @@
const fs = require('fs-extra');
module.exports = (shepherd) => {
shepherd.getMaxconKMDConf = () => {
return new shepherd.Promise((resolve, reject) => {
shepherd.fs.readFile(`${shepherd.komodoDir}/komodo.conf`, 'utf8', (err, data) => {
fs.readFile(`${shepherd.komodoDir}/komodo.conf`, 'utf8', (err, data) => {
if (err) {
shepherd.log(`kmd conf maxconnections param read failed`);
shepherd.log('kmd conf maxconnections param read failed');
resolve('unset');
} else {
const _maxcon = data.match(/maxconnections=\s*(.*)/);
if (!_maxcon) {
shepherd.log(`kmd conf maxconnections param is unset`);
shepherd.log('kmd conf maxconnections param is unset');
resolve(false);
} else {
shepherd.log(`kmd conf maxconnections param is already set to ${_maxcon[1]}`);
@ -22,7 +24,7 @@ module.exports = (shepherd) => {
shepherd.setMaxconKMDConf = (limit) => {
return new shepherd.Promise((resolve, reject) => {
shepherd.fs.readFile(`${shepherd.komodoDir}/komodo.conf`, 'utf8', (err, data) => {
fs.readFile(`${shepherd.komodoDir}/komodo.conf`, 'utf8', (err, data) => {
const _maxconVal = limit ? 1 : 10;
if (err) {
@ -37,7 +39,7 @@ module.exports = (shepherd) => {
data = `${data}\nmaxconnections=${_maxconVal}\n`;
}
shepherd.fs.writeFile(`${shepherd.komodoDir}/komodo.conf`, data, (err) => {
fs.writeFile(`${shepherd.komodoDir}/komodo.conf`, data, (err) => {
if (err) {
shepherd.log(`error writing ${shepherd.komodoDir}/komodo.conf maxconnections=${_maxconVal}`);
resolve(false);

Loading…
Cancel
Save