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

10 lines
250 B
Plaintext

__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 %>
});