diff --git a/bin/embark b/bin/embark index f9141ca09..8a3b7ae7a 100755 --- a/bin/embark +++ b/bin/embark @@ -29,7 +29,7 @@ var deploy = function(env, embarkConfig) { } program - .version('0.9.1') + .version('0.9.2') program.command('new [name]').description('New application').action(function(name) { if (name === undefined) { diff --git a/boilerplate/.gitignore b/boilerplate/.gitignore index 5620484f0..418d4a6f2 100644 --- a/boilerplate/.gitignore +++ b/boilerplate/.gitignore @@ -1,2 +1,2 @@ node_modules/ -chains/development.json +config/chains/development.json diff --git a/boilerplate/package.json b/boilerplate/package.json index c72350702..458c8ec23 100644 --- a/boilerplate/package.json +++ b/boilerplate/package.json @@ -10,8 +10,8 @@ "license": "ISC", "homepage": "", "devDependencies": { - "embark-framework": "^0.9.1", - "grunt-embark": "^0.4.1", + "embark-framework": "^0.9.2", + "grunt-embark": "^0.4.3", "grunt-contrib-clean": "^0.6.0", "grunt-contrib-coffee": "^0.13.0", "grunt-contrib-concat": "^0.5.1", diff --git a/demo/config/blockchain.yml b/demo/config/blockchain.yml index 5c17deba5..f2d841faa 100644 --- a/demo/config/blockchain.yml +++ b/demo/config/blockchain.yml @@ -19,6 +19,7 @@ staging: rpc_whitelist: "*" datadir: default network_id: 0 + deploy_timeout: 45 console: true account: init: false diff --git a/lib/compiler.js b/lib/compiler.js index 7a98aac14..31b45e729 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -21,9 +21,20 @@ Compiler.prototype.init = function(env) { }; Compiler.prototype.compile_solidity = function(contractFile) { - var cmd, result, output, json, compiled_object; + var cmd, result, output, version, json, compiled_object; - cmd = "solc --input-file " + contractFile + " --combined-json binary,json-abi"; + cmd = "solc --version"; + + result = exec(cmd, {silent: true}); + output = result.output; + version = output.split('\n')[1].split(' ')[1].slice(0,5); + + if (version == '0.1.1') { + cmd = "solc --input-file " + contractFile + " --combined-json binary,json-abi"; + } + else { + cmd = "solc --input-file " + contractFile + " --combined-json bin,abi"; + } result = exec(cmd, {silent: true}); output = result.output; @@ -39,9 +50,9 @@ Compiler.prototype.compile_solidity = function(contractFile) { var contract = json[className]; compiled_object[className] = {}; - compiled_object[className].code = contract.binary; + compiled_object[className].code = contract.binary || contact.bin; compiled_object[className].info = {}; - compiled_object[className].info.abiDefinition = JSON.parse(contract["json-abi"]); + compiled_object[className].info.abiDefinition = JSON.parse(contract["abi"] || contract["json-abi"]); } return compiled_object; diff --git a/lib/config/blockchain.js b/lib/config/blockchain.js index 15323a9a0..d0dcdd50f 100644 --- a/lib/config/blockchain.js +++ b/lib/config/blockchain.js @@ -41,6 +41,7 @@ BlockchainConfig.prototype.config = function(env) { genesisBlock: config.genesis_block, datadir: config.datadir, chains: config.chains, + deployTimeout: config.deploy_timeout || 20, networkId: networkId, maxPeers: 4, port: config.port || "30303", diff --git a/lib/deploy.js b/lib/deploy.js index e1c847097..d75f7e31d 100644 --- a/lib/deploy.js +++ b/lib/deploy.js @@ -39,7 +39,7 @@ Deploy.prototype.deploy_contract = function(contractObject, contractParams) { while ((receipt = web3.eth.getTransactionReceipt(transactionHash)) === null || receipt.contractAddress === null) { sleep(1000); time += 1; - if (time >= 20) { + if (time >= this.blockchainConfig.deployTimeout) { return false; } } @@ -176,4 +176,3 @@ Deploy.prototype.generate_and_write_abi_file = function(destFile) { }; module.exports = Deploy; - diff --git a/package.json b/package.json index 2f8517ca4..0f15b4355 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "embark-framework", - "version": "0.9.1", + "version": "0.9.2", "description": "", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" diff --git a/test/config.blockchain.js b/test/config.blockchain.js index d9db61295..5f5cc9ff8 100644 --- a/test/config.blockchain.js +++ b/test/config.blockchain.js @@ -44,6 +44,7 @@ describe('embark.config.blockchain', function() { genesis_block: 'config/genesis.json', datadir: '/tmp/embark', chains: 'chains_development.json', + deploy_timeout: 45, mine_when_needed: true, gas_limit: 123, gas_price: 100, @@ -69,6 +70,7 @@ describe('embark.config.blockchain', function() { genesisBlock: 'config/genesis.json', datadir: '/tmp/embark', chains: 'chains_development.json', + deployTimeout: 45, networkId: 0, maxPeers: 4, port: "30303", @@ -114,6 +116,7 @@ describe('embark.config.blockchain', function() { genesisBlock: undefined, datadir: '/tmp/embark', chains: undefined, + deployTimeout: 20, networkId: 0, maxPeers: 4, port: "30303",