support maxpeers option

This commit is contained in:
Iuri Matias 2016-10-30 20:35:11 -04:00
parent 6920ae9481
commit 5c283b5232
5 changed files with 8 additions and 1 deletions

View File

@ -5,6 +5,7 @@
"datadir": ".embark/development/datadir",
"mineWhenNeeded": true,
"nodiscover": true,
"maxpeers": 0,
"rpcHost": "localhost",
"rpcPort": 8545,
"rpcCorsDomain": "http://localhost:8000",

View File

@ -5,6 +5,7 @@
"datadir": ".embark/development/datadir",
"mineWhenNeeded": true,
"nodiscover": true,
"maxpeers": 0,
"rpcHost": "localhost",
"rpcPort": 8545,
"rpcCorsDomain": "http://localhost:8000",

View File

@ -20,7 +20,8 @@ var Blockchain = function(blockchainConfig, Client) {
nodiscover: this.blockchainConfig.nodiscover || false,
mine: this.blockchainConfig.mine || false,
account: this.blockchainConfig.account || {},
whisper: (this.blockchainConfig.whisper === undefined) || this.blockchainConfig.whisper
whisper: (this.blockchainConfig.whisper === undefined) || this.blockchainConfig.whisper,
maxpeers: this.blockchainConfig.maxpeers || 25
};
this.client = new Client({config: this.config});

View File

@ -74,6 +74,8 @@ GethCommands.prototype.mainCommand = function(address) {
cmd += "--nodiscover ";
}
cmd += "--maxpeers " + config.maxpeers + " ";
if (config.mineWhenNeeded || config.mine) {
cmd += "--mine ";
}

View File

@ -22,6 +22,7 @@ describe('embark.Blockchain', function() {
networkId: 12301,
port: 30303,
nodiscover: false,
maxpeers: 25,
mine: false,
whisper: true,
account: {}
@ -45,6 +46,7 @@ describe('embark.Blockchain', function() {
networkId: 1,
port: 123456,
nodiscover: true,
maxpeers: 25,
mine: true,
whisper: false,
account: {}