mirror of https://github.com/embarklabs/embark.git
Merge branch 'develop' of github.com:iurimatias/embark-framework into develop
This commit is contained in:
commit
0655957e0f
11
README.md
11
README.md
|
@ -213,3 +213,14 @@ LiveReload Plugin
|
|||
======
|
||||
|
||||
Embark works quite well with the LiveReload Plugin
|
||||
|
||||
Debugging embark
|
||||
======
|
||||
Because embark is internally using grunt tasks, debugging is not straightforward. Example
|
||||
|
||||
- you want to debug `embark deploy`
|
||||
- normally you would write something like `node-debug -p 7000 embark -- deploy`
|
||||
- This gives you nothing with embark. If you look at `deploy` command in [`./bin/embark`](https://github.com/iurimatias/embark-framework/blob/develop/bin/embark#L32-L35) you will notice that it internally runs grunt task `grunt deploy_contracts:[env]`
|
||||
- with this knowledge we can prepare proper command to start debugging
|
||||
- `node-debug -p 7000 grunt -- deploy_contracts:development`
|
||||
- [here](https://github.com/iurimatias/embark-framework/blob/develop/tasks/tasks.coffee) is list of all debuggable grunt tasks
|
||||
|
|
8337
js/web3.js
8337
js/web3.js
File diff suppressed because one or more lines are too long
|
@ -3,6 +3,7 @@ var fs = require('fs');
|
|||
var grunt = require('grunt');
|
||||
var readYaml = require('read-yaml');
|
||||
var Config = require('./config/config.js');
|
||||
var sleep = require('sleep');
|
||||
|
||||
Deploy = function(env, contractFiles, blockchainConfig, contractsConfig) {
|
||||
//this.blockchainConfig = (new Config.Blockchain()).loadConfigFile('config/blockchain.yml').config(env);
|
||||
|
@ -62,13 +63,14 @@ Deploy.prototype.deploy_contracts = function(env) {
|
|||
gasPrice: contract.gasPrice
|
||||
});
|
||||
|
||||
contractAddress = contractObject["new"].apply(contractObject, contractParams).address;
|
||||
var transactionHash = contractObject["new"].apply(contractObject, contractParams).transactionHash;
|
||||
this.deployedContracts[className] = transactionHash;
|
||||
// TODO: get this with sync until a different mechanism is implemented
|
||||
//this.deployedContracts[className] = contractAddress;
|
||||
//console.log("address is " + contractAddress);
|
||||
|
||||
this.deployedContracts[className] = contractAddress;
|
||||
|
||||
console.log("address is " + contractAddress);
|
||||
console.log("deployed " + className + " at " + contractAddress);
|
||||
}
|
||||
console.log("deployed " + className + " with transaction hash " + transactionHash);
|
||||
//console.log("deployed " + className + " at " + contractAddress);
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -84,7 +86,17 @@ Deploy.prototype.generate_abi_file = function() {
|
|||
var contract = this.contractDB[className];
|
||||
|
||||
var abi = JSON.stringify(contract.compiled.info.abiDefinition);
|
||||
var contractAddress = deployedContract;
|
||||
var transactionHash = deployedContract;
|
||||
//var contractAddress = deployedContract;
|
||||
|
||||
console.log('trying to obtain ' + className + ' address...');
|
||||
var receipt = null;
|
||||
while ((receipt = web3.eth.getTransactionReceipt(transactionHash)) === null) {
|
||||
sleep.sleep(1);
|
||||
}
|
||||
var contractAddress = receipt.contractAddress;
|
||||
console.log('address is ' + contractAddress);
|
||||
|
||||
result += className + "Abi = " + abi + ";";
|
||||
result += className + "Contract = web3.eth.contract(" + className + "Abi);";
|
||||
result += className + " = " + className + "Contract.at('" + contractAddress + "');";
|
||||
|
|
15
package.json
15
package.json
|
@ -25,17 +25,18 @@
|
|||
"grunt-contrib-uglify": "^0.9.1",
|
||||
"grunt-contrib-watch": "^0.6.1",
|
||||
"grunt-open": "^0.2.3",
|
||||
"hashmerge": "^1.0.2",
|
||||
"jasmine": "^2.3.1",
|
||||
"matchdep": "^0.3.0",
|
||||
"methodmissing": "^0.0.3",
|
||||
"python": "^0.0.4",
|
||||
"read-yaml": "^1.0.0",
|
||||
"shelljs": "^0.5.0",
|
||||
"web3": "^0.5.0",
|
||||
"wrench": "^1.5.8",
|
||||
"hashmerge": "^1.0.2",
|
||||
"sleep": "^2.0.0",
|
||||
"sync-me": "^0.1.1",
|
||||
"python": "^0.0.4",
|
||||
"methodmissing": "^0.0.3",
|
||||
"jasmine": "^2.3.1",
|
||||
"toposort": "^0.2.10"
|
||||
"toposort": "^0.2.10",
|
||||
"web3": "^0.8.1",
|
||||
"wrench": "^1.5.8"
|
||||
},
|
||||
"author": "Iuri Matias <iuri.matias@gmail.com>",
|
||||
"contributors": [],
|
||||
|
|
Loading…
Reference in New Issue