mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-11 14:34:40 +00:00
refactor common geth command options into the a common method
This commit is contained in:
parent
0a2a26fd29
commit
e58671e742
@ -46,9 +46,9 @@ GethCommands.prototype.newAccountCommand = function() {
|
||||
return cmd + "account new ";
|
||||
};
|
||||
|
||||
GethCommands.prototype.listAccountsCommand = function() {
|
||||
GethCommands.prototype.commonOptions = function() {
|
||||
var config = this.config;
|
||||
var cmd = "geth ";
|
||||
var cmd = "";
|
||||
|
||||
if (config.networkType === 'testnet') {
|
||||
cmd += "--testnet ";
|
||||
@ -66,7 +66,11 @@ GethCommands.prototype.listAccountsCommand = function() {
|
||||
cmd += "--password " + config.account.password + " ";
|
||||
}
|
||||
|
||||
return cmd + "account list ";
|
||||
return cmd;
|
||||
};
|
||||
|
||||
GethCommands.prototype.listAccountsCommand = function() {
|
||||
return "geth " + this.commonOptions() + "account list ";
|
||||
};
|
||||
|
||||
GethCommands.prototype.mainCommand = function(address) {
|
||||
@ -74,21 +78,7 @@ GethCommands.prototype.mainCommand = function(address) {
|
||||
var cmd = "geth ";
|
||||
var rpc_api = ['eth', 'web3'];
|
||||
|
||||
if (config.datadir) {
|
||||
cmd += "--datadir=\"" + config.datadir + "\" ";
|
||||
}
|
||||
|
||||
if (config.networkType === 'testnet') {
|
||||
cmd += "--testnet ";
|
||||
} else if (config.networkType === 'olympic') {
|
||||
cmd += "--olympic ";
|
||||
} else if (config.networkType === 'custom') {
|
||||
cmd += "--networkid " + config.networkId + " ";
|
||||
}
|
||||
|
||||
if (config.account && config.account.password) {
|
||||
cmd += "--password " + config.account.password + " ";
|
||||
}
|
||||
cmd += this.commonOptions();
|
||||
|
||||
cmd += "--port " + "30303" + " ";
|
||||
cmd += "--rpc ";
|
||||
|
Loading…
x
Reference in New Issue
Block a user