I cannot unlock my account.
I decrypted my account from encrypted accoun, and want to unlock it to deploy contract.
However, I am getting this error,
Node error: {"code":-32000,"message":"could not decrypt key with given passphrase"
This is my web3 code.
const decryptEtherAccount = await web3.eth.accounts.decrypt(etherAccount,'test!')
web3.eth.defaultAccount = await decryptEtherAccount.address
const account = await web3.eth.getAccounts()
const address = await web3.eth.personal.unlockAccount(account[0], decryptEtherAccount.privateKey, 1000)
console.log(address)
Are there any problems of my code?
Also, could we unlock account, not node?
web3.eth.personal.newAccount(password, [callback])
, so I think I don't need to unlock account. Did I made mistake ?I think I don't need to unlock account
.