mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-27 21:00:46 +00:00
support maxpeers option
This commit is contained in:
parent
6920ae9481
commit
5c283b5232
@ -5,6 +5,7 @@
|
|||||||
"datadir": ".embark/development/datadir",
|
"datadir": ".embark/development/datadir",
|
||||||
"mineWhenNeeded": true,
|
"mineWhenNeeded": true,
|
||||||
"nodiscover": true,
|
"nodiscover": true,
|
||||||
|
"maxpeers": 0,
|
||||||
"rpcHost": "localhost",
|
"rpcHost": "localhost",
|
||||||
"rpcPort": 8545,
|
"rpcPort": 8545,
|
||||||
"rpcCorsDomain": "http://localhost:8000",
|
"rpcCorsDomain": "http://localhost:8000",
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
"datadir": ".embark/development/datadir",
|
"datadir": ".embark/development/datadir",
|
||||||
"mineWhenNeeded": true,
|
"mineWhenNeeded": true,
|
||||||
"nodiscover": true,
|
"nodiscover": true,
|
||||||
|
"maxpeers": 0,
|
||||||
"rpcHost": "localhost",
|
"rpcHost": "localhost",
|
||||||
"rpcPort": 8545,
|
"rpcPort": 8545,
|
||||||
"rpcCorsDomain": "http://localhost:8000",
|
"rpcCorsDomain": "http://localhost:8000",
|
||||||
|
@ -20,7 +20,8 @@ var Blockchain = function(blockchainConfig, Client) {
|
|||||||
nodiscover: this.blockchainConfig.nodiscover || false,
|
nodiscover: this.blockchainConfig.nodiscover || false,
|
||||||
mine: this.blockchainConfig.mine || false,
|
mine: this.blockchainConfig.mine || false,
|
||||||
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 || 25
|
||||||
};
|
};
|
||||||
|
|
||||||
this.client = new Client({config: this.config});
|
this.client = new Client({config: this.config});
|
||||||
|
@ -74,6 +74,8 @@ GethCommands.prototype.mainCommand = function(address) {
|
|||||||
cmd += "--nodiscover ";
|
cmd += "--nodiscover ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmd += "--maxpeers " + config.maxpeers + " ";
|
||||||
|
|
||||||
if (config.mineWhenNeeded || config.mine) {
|
if (config.mineWhenNeeded || config.mine) {
|
||||||
cmd += "--mine ";
|
cmd += "--mine ";
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ describe('embark.Blockchain', function() {
|
|||||||
networkId: 12301,
|
networkId: 12301,
|
||||||
port: 30303,
|
port: 30303,
|
||||||
nodiscover: false,
|
nodiscover: false,
|
||||||
|
maxpeers: 25,
|
||||||
mine: false,
|
mine: false,
|
||||||
whisper: true,
|
whisper: true,
|
||||||
account: {}
|
account: {}
|
||||||
@ -45,6 +46,7 @@ describe('embark.Blockchain', function() {
|
|||||||
networkId: 1,
|
networkId: 1,
|
||||||
port: 123456,
|
port: 123456,
|
||||||
nodiscover: true,
|
nodiscover: true,
|
||||||
|
maxpeers: 25,
|
||||||
mine: true,
|
mine: true,
|
||||||
whisper: false,
|
whisper: false,
|
||||||
account: {}
|
account: {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user