Commit 8e42d5f3 authored by dev0tion's avatar dev0tion

Add testnet parameter to daemon

parent 0ef810ed
...@@ -11,8 +11,10 @@ const url = require('url'); ...@@ -11,8 +11,10 @@ const url = require('url');
const os = require('os'); const os = require('os');
let serve; let serve;
let testnet;
const args = process.argv.slice(1); const args = process.argv.slice(1);
serve = args.some(val => val === "--serve"); serve = args.some(val => val === "--serve");
testnet = args.some(val => val === "--testnet");
if (serve) { if (serve) {
require('electron-reload')(__dirname, { require('electron-reload')(__dirname, {
...@@ -158,9 +160,16 @@ function startBitcoinApi() { ...@@ -158,9 +160,16 @@ function startBitcoinApi() {
apiPath = path.resolve(__dirname, 'assets\\daemon\\Stratis.BreezeD.exe'); apiPath = path.resolve(__dirname, 'assets\\daemon\\Stratis.BreezeD.exe');
} }
if(!testnet) {
bitcoinProcess = spawnBitcoin(apiPath, {
detached: true
});
} else if (testnet) {
bitcoinProcess = spawnBitcoin(apiPath, ['-testnet'], { bitcoinProcess = spawnBitcoin(apiPath, ['-testnet'], {
detached: true detached: true
}); });
}
bitcoinProcess.stdout.on('data', (data) => { bitcoinProcess.stdout.on('data', (data) => {
writeLog(`Bitcoin: ${data}`); writeLog(`Bitcoin: ${data}`);
...@@ -177,9 +186,16 @@ function startStratisApi() { ...@@ -177,9 +186,16 @@ function startStratisApi() {
apiPath = path.resolve(__dirname, 'assets\\daemon\\Stratis.BreezeD.exe'); apiPath = path.resolve(__dirname, 'assets\\daemon\\Stratis.BreezeD.exe');
} }
if (!testnet) {
stratisProcess = spawnStratis(apiPath, ['stratis'], {
detached: true
});
} else if (testnet) {
stratisProcess = spawnStratis(apiPath, ['stratis', '-testnet'], { stratisProcess = spawnStratis(apiPath, ['stratis', '-testnet'], {
detached: true detached: true
}); });
}
stratisProcess.stdout.on('data', (data) => { stratisProcess.stdout.on('data', (data) => {
writeLog(`Stratis: ${data}`); writeLog(`Stratis: ${data}`);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment