mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-17 01:37:26 +00:00
make maxpeers configurable
This commit is contained in:
parent
29d25e3621
commit
6ff72432d6
@ -6,6 +6,7 @@ development:
|
|||||||
genesis_block: config/genesis.json
|
genesis_block: config/genesis.json
|
||||||
datadir: /tmp/embark
|
datadir: /tmp/embark
|
||||||
mine_when_needed: true
|
mine_when_needed: true
|
||||||
|
max_peers: 0
|
||||||
gas_limit: 500000
|
gas_limit: 500000
|
||||||
gas_price: 10000000000000
|
gas_price: 10000000000000
|
||||||
console: false
|
console: false
|
||||||
@ -18,6 +19,7 @@ staging:
|
|||||||
rpc_whitelist: "*"
|
rpc_whitelist: "*"
|
||||||
datadir: default
|
datadir: default
|
||||||
network_id: 0
|
network_id: 0
|
||||||
|
max_peers: 4
|
||||||
console: true
|
console: true
|
||||||
account:
|
account:
|
||||||
init: false
|
init: false
|
||||||
@ -28,6 +30,7 @@ production:
|
|||||||
rpc_whitelist: "*"
|
rpc_whitelist: "*"
|
||||||
datadir: default
|
datadir: default
|
||||||
network_id: 1
|
network_id: 1
|
||||||
|
max_peers: 4
|
||||||
console: true
|
console: true
|
||||||
account:
|
account:
|
||||||
init: false
|
init: false
|
||||||
|
@ -31,7 +31,7 @@ Blockchain.prototype.generate_basic_command = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO: this should be configurable
|
//TODO: this should be configurable
|
||||||
cmd += "--maxpeers 0 ";
|
cmd += "--maxpeers " + config.maxPeers + " ";
|
||||||
|
|
||||||
if (config.account.password !== void 0) {
|
if (config.account.password !== void 0) {
|
||||||
cmd += "--password " + config.account.password + " ";
|
cmd += "--password " + config.account.password + " ";
|
||||||
|
@ -41,6 +41,7 @@ BlockchainConfig.prototype.config = function(env) {
|
|||||||
genesisBlock: config.genesis_block,
|
genesisBlock: config.genesis_block,
|
||||||
datadir: config.datadir,
|
datadir: config.datadir,
|
||||||
networkId: networkId,
|
networkId: networkId,
|
||||||
|
maxPeers: 4,
|
||||||
port: config.port || "30303",
|
port: config.port || "30303",
|
||||||
console_toggle: config.console || false,
|
console_toggle: config.console || false,
|
||||||
mine_when_needed: config.mine_when_needed || false,
|
mine_when_needed: config.mine_when_needed || false,
|
||||||
|
@ -10,7 +10,7 @@ describe('embark.blockchain', function() {
|
|||||||
var blockchain = new Blockchain(blockchainConfig);
|
var blockchain = new Blockchain(blockchainConfig);
|
||||||
|
|
||||||
it('should return correct cmd', function() {
|
it('should return correct cmd', function() {
|
||||||
assert.strictEqual(blockchain.generate_basic_command(), "geth --datadir=\"/tmp/embark\" --logfile=\"/tmp/embark.log\" --port 30303 --rpc --rpcport 8101 --networkid "+blockchainConfig.networkId+" --rpccorsdomain \"*\" --minerthreads \"1\" --mine --genesis=\"config/genesis.json\" --maxpeers 0 --password config/password ");
|
assert.strictEqual(blockchain.generate_basic_command(), "geth --datadir=\"/tmp/embark\" --logfile=\"/tmp/embark.log\" --port 30303 --rpc --rpcport 8101 --networkid "+blockchainConfig.networkId+" --rpccorsdomain \"*\" --minerthreads \"1\" --mine --genesis=\"config/genesis.json\" --maxpeers 4 --password config/password ");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -67,6 +67,7 @@ describe('embark.config.blockchain', function() {
|
|||||||
genesisBlock: 'config/genesis.json',
|
genesisBlock: 'config/genesis.json',
|
||||||
datadir: '/tmp/embark',
|
datadir: '/tmp/embark',
|
||||||
networkId: 0,
|
networkId: 0,
|
||||||
|
maxPeers: 4,
|
||||||
port: "30303",
|
port: "30303",
|
||||||
console_toggle: false,
|
console_toggle: false,
|
||||||
mine_when_needed: true,
|
mine_when_needed: true,
|
||||||
@ -108,6 +109,7 @@ describe('embark.config.blockchain', function() {
|
|||||||
genesisBlock: undefined,
|
genesisBlock: undefined,
|
||||||
datadir: '/tmp/embark',
|
datadir: '/tmp/embark',
|
||||||
networkId: 0,
|
networkId: 0,
|
||||||
|
maxPeers: 4,
|
||||||
port: "30303",
|
port: "30303",
|
||||||
console_toggle: false,
|
console_toggle: false,
|
||||||
mine_when_needed: true,
|
mine_when_needed: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user