3

I am trying to link an account that I created use geth with an instance of web3 that I'm running in a node repl. In order to add the account, I did the following:

1) I decrypted the JSON private key file created by Geth, in the MyEtherWallet tool.

2) Added the account with the command web3.eth.accounts.wallet.add(<private key>)

This seemed to work, but upon closer inspection, the address of the account that had been added differed from the address of the account.

Can anyone explain why this is happening, and what I need to do differently to add this specific account to web3 so that I can deploy contracts using that account?

TylerH
  • 20,799
  • 66
  • 75
  • 101
fraxture
  • 5,113
  • 4
  • 43
  • 83
  • Check if `web3.eth.accounts.privateKeyToAccount` gives you the address you’re expecting. My guess is you’re simply using a private key that is different than the one you want. – Adam Kipnis May 07 '18 at 15:06

0 Answers0