2

I've tested with accounts created and unlocked in geth and my sample app works fine. I'm now going distributed with my accounts and have added eth-lightwallet and HookedWeb3Provider to put the account management on the user end.

I generate a couple of addresses and then try to create a contract. However I get the message 'account is locked'.

I've configured the hookedwebprovider as in the samples:

var web3Provider = new HookedWeb3Provider({
      host: "http://myaddress:8545",
      transaction_signer: keystore
    });
web3.setProvider(web3Provider);

Then try to use the generated addresses

 var account = keystore.getAddresses()[0];
 MyContract.new({from: account, gas: 10000000});

I had expected the error to be something like insufficent ether/gas, since the balances are 0. Do I need to call the new function in a different way or configure something else?

0

You need to specify the provider for each contract. So you'll do:

MyContract.setProvider(web3Provider);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.