extract method for determing rpc options

This commit is contained in:
Iuri Matias 2017-02-21 21:04:15 -05:00
parent b29f23e28c
commit 87ff194ce4
1 changed files with 14 additions and 6 deletions

View File

@ -63,12 +63,8 @@ GethCommands.prototype.listAccountsCommand = function() {
return this.geth_bin + " " + this.commonOptions() + "account list ";
};
GethCommands.prototype.mainCommand = function(address) {
var config = this.config;
var cmd = this.geth_bin + " ";
var rpc_api = (this.config.rpcApi || ['eth', 'web3', 'net']);
cmd += this.commonOptions();
GethCommands.prototype.determineRpcOptions = function(config) {
var cmd = "";
cmd += "--port " + config.port + " ";
cmd += "--rpc ";
@ -87,6 +83,18 @@ GethCommands.prototype.mainCommand = function(address) {
console.log('==================================');
}
return cmd;
};
GethCommands.prototype.mainCommand = function(address) {
var config = this.config;
var cmd = this.geth_bin + " ";
var rpc_api = (this.config.rpcApi || ['eth', 'web3', 'net']);
cmd += this.commonOptions();
cmd += this.determineRpcOptions(this.config);
if (config.nodiscover) {
cmd += "--nodiscover ";
}