support maxpeers option
This commit is contained in:
parent
6920ae9481
commit
5c283b5232
|
@ -5,6 +5,7 @@
|
|||
"datadir": ".embark/development/datadir",
|
||||
"mineWhenNeeded": true,
|
||||
"nodiscover": true,
|
||||
"maxpeers": 0,
|
||||
"rpcHost": "localhost",
|
||||
"rpcPort": 8545,
|
||||
"rpcCorsDomain": "http://localhost:8000",
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"datadir": ".embark/development/datadir",
|
||||
"mineWhenNeeded": true,
|
||||
"nodiscover": true,
|
||||
"maxpeers": 0,
|
||||
"rpcHost": "localhost",
|
||||
"rpcPort": 8545,
|
||||
"rpcCorsDomain": "http://localhost:8000",
|
||||
|
|
|
@ -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});
|
||||
|
|
|
@ -74,6 +74,8 @@ GethCommands.prototype.mainCommand = function(address) {
|
|||
cmd += "--nodiscover ";
|
||||
}
|
||||
|
||||
cmd += "--maxpeers " + config.maxpeers + " ";
|
||||
|
||||
if (config.mineWhenNeeded || config.mine) {
|
||||
cmd += "--mine ";
|
||||
}
|
||||
|
|
|
@ -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: {}
|
||||
|
|
Loading…
Reference in New Issue