diff --git a/lib/core/config.js b/lib/core/config.js index ae45b6905..869f5fb75 100644 --- a/lib/core/config.js +++ b/lib/core/config.js @@ -195,7 +195,7 @@ Config.prototype.loadBlockchainConfigFile = function() { Config.prototype.loadContractsConfigFile = function() { var defaultVersions = { "web3": "1.0.0-beta", - "solc": "0.4.17" + "solc": "0.4.25" }; var versions = utils.recursiveMerge(defaultVersions, this.embarkConfig.versions || {}); diff --git a/lib/modules/blockchain_process/blockchain.js b/lib/modules/blockchain_process/blockchain.js index a6e993a4e..97b68aae7 100644 --- a/lib/modules/blockchain_process/blockchain.js +++ b/lib/modules/blockchain_process/blockchain.js @@ -10,7 +10,7 @@ const DevFunds = require('./dev_funds.js'); const {defaultHost, dockerHostSwap} = require('../../utils/host'); -/*eslint complexity: ["error", 36]*/ +/*eslint complexity: ["error", 37]*/ var Blockchain = function(options) { this.blockchainConfig = options.blockchainConfig; this.env = options.env || 'development'; @@ -59,11 +59,18 @@ var Blockchain = function(options) { verbosity: this.blockchainConfig.verbosity }; - if (this.blockchainConfig === {} || JSON.stringify(this.blockchainConfig) === '{"enabled":true}') { + if (this.blockchainConfig === {} || this.blockchainConfig.default) { this.config.account = {}; - this.config.account.password = fs.embarkPath("templates/boilerplate/config/development/password"); - this.config.genesisBlock = fs.embarkPath("templates/boilerplate/config/development/genesis.json"); + if (this.env === 'development') { + this.isDev = true; + } else { + this.config.account.password = fs.embarkPath("templates/boilerplate/config/privatenet/password"); + this.config.genesisBlock = fs.embarkPath("templates/boilerplate/config/privatenet/genesis.json"); + } this.config.datadir = fs.dappPath(".embark/development/datadir"); + this.config.wsOrigins = "http://localhost:8000"; + this.config.rpcCorsDomain = "http://localhost:8000"; + this.config.targetGasLimit = 8000000; } const spaceMessage = 'The path for %s in blockchain config contains spaces, please remove them'; diff --git a/test/config.js b/test/config.js index 9bd69d26b..7d9c83ad9 100644 --- a/test/config.js +++ b/test/config.js @@ -42,7 +42,7 @@ describe('embark.Config', function () { it('should load contract config correctly', function () { config.loadContractsConfigFile(); let expectedConfig = { - versions: {'web3': '1.0.0-beta', solc: '0.4.17'}, + versions: {'web3': '1.0.0-beta', solc: '0.4.25'}, deployment: {host: 'localhost', port: 8545, type: 'rpc'}, dappConnection: ['$WEB3', 'localhost:8545'], "gas": "auto",