option added

This commit is contained in:
Iuri Matias 2017-02-18 08:41:18 -05:00
parent eb36af87b0
commit 03a6b6c48d
3 changed files with 12 additions and 2 deletions

View File

@ -22,7 +22,9 @@ var Blockchain = function(blockchainConfig, Client) {
account: this.blockchainConfig.account || {}, account: this.blockchainConfig.account || {},
whisper: (this.blockchainConfig.whisper === undefined) || this.blockchainConfig.whisper, whisper: (this.blockchainConfig.whisper === undefined) || this.blockchainConfig.whisper,
maxpeers: ((this.blockchainConfig.maxpeers === 0) ? 0 : (this.blockchainConfig.maxpeers || 25)), maxpeers: ((this.blockchainConfig.maxpeers === 0) ? 0 : (this.blockchainConfig.maxpeers || 25)),
bootnodes: this.blockchainConfig.bootnodes || "" bootnodes: this.blockchainConfig.bootnodes || "",
rpcApi: (this.blockchainConfig.rpcApi || ['eth', 'web3', 'net']),
vmdebug: this.blockchainConfig.vmdebug || false
}; };
this.client = new Client({config: this.config}); this.client = new Client({config: this.config});

View File

@ -49,7 +49,7 @@ GethCommands.prototype.listAccountsCommand = function() {
GethCommands.prototype.mainCommand = function(address) { GethCommands.prototype.mainCommand = function(address) {
var config = this.config; var config = this.config;
var cmd = "geth "; var cmd = "geth ";
var rpc_api = ['eth', 'web3']; var rpc_api = (this.config.rpcApi || ['eth', 'web3', 'net']);
cmd += this.commonOptions(); cmd += this.commonOptions();
@ -74,6 +74,10 @@ GethCommands.prototype.mainCommand = function(address) {
cmd += "--nodiscover "; cmd += "--nodiscover ";
} }
if (config.vmdebug) {
cmd += "--vmdebug ";
}
cmd += "--maxpeers " + config.maxpeers + " "; cmd += "--maxpeers " + config.maxpeers + " ";
if (config.mineWhenNeeded || config.mine) { if (config.mineWhenNeeded || config.mine) {

View File

@ -18,12 +18,14 @@ describe('embark.Blockchain', function() {
mineWhenNeeded: false, mineWhenNeeded: false,
rpcHost: 'localhost', rpcHost: 'localhost',
rpcPort: 8545, rpcPort: 8545,
rpcApi: ['eth', 'web3', 'net'],
rpcCorsDomain: false, rpcCorsDomain: false,
networkId: 12301, networkId: 12301,
port: 30303, port: 30303,
nodiscover: false, nodiscover: false,
maxpeers: 25, maxpeers: 25,
mine: false, mine: false,
vmdebug: false,
whisper: true, whisper: true,
account: {}, account: {},
bootnodes: "" bootnodes: ""
@ -43,12 +45,14 @@ describe('embark.Blockchain', function() {
mineWhenNeeded: true, mineWhenNeeded: true,
rpcHost: 'someserver', rpcHost: 'someserver',
rpcPort: 12345, rpcPort: 12345,
rpcApi: ['eth', 'web3', 'net'],
rpcCorsDomain: true, rpcCorsDomain: true,
networkId: 1, networkId: 1,
port: 123456, port: 123456,
nodiscover: true, nodiscover: true,
maxpeers: 25, maxpeers: 25,
mine: true, mine: true,
vmdebug: false,
whisper: false, whisper: false,
account: {}, account: {},
bootnodes: "" bootnodes: ""