-1

In an old version of web3 web3.eth.accounts[0] returns a sepcific account. I used it as a parameter for the vote function like this:

app.vote(1, { from: web3.eth.accounts[0]})

Since version 1.2.x web3 uses web3.eth.getAccounts() to return a list of accounts the node controls.

How can I get a specific account like I did before with this web3 version?

TylerH
  • 20,799
  • 66
  • 75
  • 101

1 Answers1

-1
web3.eth.defaultAccount;
> undefined

// set the default account
web3.eth.defaultAccount = '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe';
TylerH
  • 20,799
  • 66
  • 75
  • 101