diff --git a/lib/chain_manager.js b/lib/chain_manager.js index edc48bbde..bc93be3b2 100644 --- a/lib/chain_manager.js +++ b/lib/chain_manager.js @@ -28,6 +28,10 @@ ChainManager.prototype.loadConfig = function(config) { ChainManager.prototype.init = function(env, config) { web3.setProvider(new web3.providers.HttpProvider("http://" + config.rpcHost + ":" + config.rpcPort)); + var block = web3.eth.getBlock(0); + if(!block){ + throw new Error("Cannot get the genesis block, is embark blockchain running ?"); + } var chainId = web3.eth.getBlock(0).hash; if (this.chainManagerConfig[chainId] === undefined) {