diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index 5ac8981f0..524cba5a8 100644 --- a/lib/cmds/blockchain/blockchain.js +++ b/lib/cmds/blockchain/blockchain.js @@ -4,12 +4,16 @@ var fs = require('../../core/fs.js'); var GethCommands = require('./geth_commands.js'); -/*eslint complexity: ["error", 26]*/ +/*eslint complexity: ["error", 30]*/ var Blockchain = function(options) { this.blockchainConfig = options.blockchainConfig; this.env = options.env || 'development'; this.client = options.client; + if ((this.blockchainConfig === {} || JSON.stringify(this.blockchainConfig) === '{"enabled":true}') && this.env !== 'development') { + console.log("===> warning: running default config on a non-development environment"); + } + this.config = { geth_bin: this.blockchainConfig.geth_bin || 'geth', networkType: this.blockchainConfig.networkType || 'custom', @@ -36,6 +40,13 @@ var Blockchain = function(options) { vmdebug: this.blockchainConfig.vmdebug || false }; + if (this.blockchainConfig === {} || JSON.stringify(this.blockchainConfig) === '{"enabled":true}') { + this.config.account = {}; + this.config.account.password = fs.embarkPath("boilerplate/config/development/password"); + this.config.genesisBlock = fs.embarkPath("boilerplate/config/development/genesis.json"); + this.config.datadir = fs.embarkPath(".embark/development/datadir"); + } + this.client = new options.client({config: this.config, env: this.env}); };