feat(daemon): set default network to MAINNET

This commit is contained in:
George Lima 2019-03-19 22:28:35 -03:00
parent 93dd9768c5
commit b592bfbd68
1 changed files with 9 additions and 1 deletions

View File

@ -38,13 +38,14 @@ const getDaemonOptions = ({ username, password, optionsFromZcashConf }) => {
-metricsrefreshtime
Number of seconds between metrics refreshes
*/
const defaultOptions = [
'-showmetrics',
'--metricsui=0',
'-metricsrefreshtime=1',
`-rpcuser=${username}`,
`-rpcpassword=${password}`,
...(isTestnet ? ['-testnet', '-addnode=testnet.z.cash'] : ['-addnode=mainnet.z.cash']),
...(isTestnet() ? ['-testnet', '-addnode=testnet.z.cash'] : ['-addnode=mainnet.z.cash']),
// Overwriting the settings with values taken from "zcash.conf"
...optionsFromZcashConf,
];
@ -103,6 +104,13 @@ const runDaemon: () => Promise<?ChildProcess> = () => new Promise(async (resolve
return resolve();
}
store.set(EMBEDDED_DAEMON, true);
// Default to mainnet
if (!store.get(ZCASH_NETWORK)) {
store.set(ZCASH_NETWORK, MAINNET);
}
if (!optionsFromZcashConf.rpcuser) store.set('rpcuser', uuid());
if (!optionsFromZcashConf.rpcpassword) store.set('rpcpassword', uuid());