generate an abi file compatible with mist and metamask
This commit is contained in:
parent
2fbb41b113
commit
cf3cfe51ca
|
@ -193,16 +193,20 @@ Deploy.prototype.execute_cmds = function(cmds) {
|
|||
console.log("executing: " + cmd);
|
||||
eval(cmd);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Deploy.prototype.generate_provider_file = function() {
|
||||
var result = "";
|
||||
result += "var web3 = new Web3();";
|
||||
result += "web3.setProvider(new web3.providers.HttpProvider('http://" + this.blockchainConfig.rpcHost + ":" + this.blockchainConfig.rpcPort + "'));";
|
||||
|
||||
result += "if (typeof web3 !== 'undefined' && typeof Web3 !== 'undefined') {";
|
||||
result += 'web3 = new Web3(web3.currentProvider);';
|
||||
result += "} else if (typeof Web3 !== 'undefined') {";
|
||||
result += 'web3 = new Web3(new Web3.providers.HttpProvider("http://' + this.blockchainConfig.rpcHost + ':' + this.blockchainConfig.rpcPort + '"));';
|
||||
result += '}';
|
||||
result += "web3.eth.defaultAccount = web3.eth.accounts[0];";
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
Deploy.prototype.generate_abi_file = function() {
|
||||
var result = "";
|
||||
|
|
Loading…
Reference in New Issue