add error message if attemping to start without node already running

This commit is contained in:
Iuri Matias 2016-09-23 12:43:07 +08:00
parent 2f9c0a2996
commit a1bedff7e1
1 changed files with 6 additions and 0 deletions

View File

@ -155,6 +155,12 @@ var Embark = {
var web3Endpoint = 'http://' + self.config.blockchainConfig.rpcHost + ':' + self.config.blockchainConfig.rpcPort; var web3Endpoint = 'http://' + self.config.blockchainConfig.rpcHost + ':' + self.config.blockchainConfig.rpcPort;
web3.setProvider(new web3.providers.HttpProvider(web3Endpoint)); web3.setProvider(new web3.providers.HttpProvider(web3Endpoint));
if (!web3.isConnected()) {
console.log(("Couldn't connect to " + web3Endpoint.underline + " are you sure it's on?").red);
console.log("make sure you have an ethereum node or simulator running. e.g 'embark blockchain'".magenta);
exit();
}
var deploy = new Deploy(web3, contractsManager, Embark.logger); var deploy = new Deploy(web3, contractsManager, Embark.logger);
deploy.deployAll(function() { deploy.deployAll(function() {
callback(null, contractsManager); callback(null, contractsManager);