add support for the bootnodes config

This commit is contained in:
Iuri Matias 2017-02-18 08:24:23 -05:00
parent 566812696d
commit eb36af87b0
6 changed files with 13 additions and 6 deletions

View File

@ -33,6 +33,6 @@
"rpcPort": 8545,
"datadir": "yourdatadir",
"networkId": "123",
"nodes": []
"bootnodes": ""
}
}

View File

@ -33,6 +33,6 @@
"rpcPort": 8545,
"datadir": "yourdatadir",
"networkId": "123",
"nodes": []
"bootnodes": ""
}
}

View File

@ -21,7 +21,8 @@ var Blockchain = function(blockchainConfig, Client) {
mine: this.blockchainConfig.mine || false,
account: this.blockchainConfig.account || {},
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 || ""
};
this.client = new Client({config: this.config});

View File

@ -80,6 +80,10 @@ GethCommands.prototype.mainCommand = function(address) {
cmd += "--mine ";
}
if (config.bootnodes && config.bootnodes !== "" && config.bootnodes !== []) {
cmd += "--bootnodes " + config.bootnodes;
}
if (config.whisper) {
cmd += "--shh ";
rpc_api.push('shh');

View File

@ -25,7 +25,8 @@ describe('embark.Blockchain', function() {
maxpeers: 25,
mine: false,
whisper: true,
account: {}
account: {},
bootnodes: ""
};
var blockchain = Blockchain(config, 'geth');
@ -49,7 +50,8 @@ describe('embark.Blockchain', function() {
maxpeers: 25,
mine: true,
whisper: false,
account: {}
account: {},
bootnodes: ""
};
var blockchain = Blockchain(config, 'geth');

View File

@ -33,6 +33,6 @@
"rpcPort": 8545,
"datadir": "yourdatadir",
"networkId": "123",
"nodes": []
"bootnodes": ""
}
}