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

quervernetzt
  • 297
  • 1
  • 9

2 Answers2

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.

Rob Hitchens
  • 55,151
  • 11
  • 89
  • 145
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);} ) } );
The Burger King
  • 350
  • 3
  • 13