embark/lib/modules/code_generator/code_templates/define-web3-simple.js.ejs

10 lines
250 B
Plaintext
Raw Normal View History

2017-10-14 00:01:35 +00:00
__mainContext.web3 = undefined;
web3 = new Web3(new Web3.providers.HttpProvider("<%- url -%>"));
web3.eth.getAccounts(function(err, accounts) {
if (err) {
return done(new Error(err));
}
web3.defaultAccount = accounts[0];
<%- done %>
});