3

I try to migrate a smart contract to a private network via truffle on Windows 10. I specify a certain account in truffle.js and so far I get the following error:

Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: authentication needed: password or unlock

What is the best way or the best ways to unlock the (remote) account so that the migration via migrate --network networkName can take place?

Thanks

2

There might be a newer, better way, but this has always worked for me. Go to geth, and

web3.personal.unlockAccount(web3.personal.listAccounts[0], "<password>", 15000);

15000 (seconds) just tells it to keep the first account unlocked for a long time so you can work in peace.

Hope it helps.

  • Thanks. Yes that would be via running a local node or? I was wondering if that is possible via Truffle. – quervernetzt Mar 11 '17 at 8:39
1

The above did not work for me. This worked:

web3.eth.getAccounts( (err,res) => {first=res[0]; web3.eth.personal.unlockAccount(first, "123456", 15000, (err,res)=>{console.log(err,res);} ) } );

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.