I first started geth:  geth --syncmode "light" --rpc --rpcaddr --rpccorsdomain "*" --datadir ~/eth_blocks/ and then used: geth account new.

I verified that there is a new entry in ~/Library/Ethereum/keystore/.

Then when i run this code:

var Web3 = require('web3')
var web3 = new Web3(new Web3.providers.HttpProvider(''))
web3.eth.getAccounts(function(error, data) {

It logs an empty array: []

Why is it not outputting what is in the keystore?

  • 1
    You should probably get those accounts unlocked (on the node side). – goodvibration Mar 2 '19 at 20:53
  • Here's a related question with more info on unlocking your geth accounts. – sfmiller940 Mar 29 '19 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.