I'm starting from square zero, sorry. I'm just trying to get a javascript console up and running so that I can learn more about ENS:


I've spun up an Ubuntu 16.04.2 VM and installed geth, so in one window I just fire it up.

Then in another window I'm just trying to preload ensutils.js so I can resolve a few ENS names.

I try this:

$ geth --preload "/home/phb/ens/ensutils.js" attach

and this happens:

Fatal: Failed to start the JavaScript console: /home/phb/ens/ensutils.js: Error: invalid address
at web3.js:3879:15
at web3.js:3683:22
at web3.js:4948:28
at map (<native code>)
at web3.js:4947:12
at web3.js:4973:18
at web3.js:4998:23
at web3.js:4026:22
at apply (<native code>)
at web3.js:4151:12

Now I have no idea what to do with that. I'm hoping to get to the point where I have a geth console and I can try things like:


If I can just get the extremly newbie basics of how to get that far I, it'll help. Thx in advance.

  • I am suspecting this is the direction I'm supposed to go: web3.eth.defaultAccount = eth.accounts[0] but I'm still getting an Invalid address Commented Jul 22, 2017 at 14:38
  • 1
    At the geth console what is the value returned by eth.getBlock('latest').number? "Invalid address" in ensutils.js is often the result of an unsynch'd blockchain.
    – carver
    Commented Aug 4, 2017 at 19:31
  • instead of web3.eth.accounts[0] use the getAccounts function (with callback or simply); let accounts = web3.eth.getAccounts(); web3.eth.defaultAccount = accounts[0];
    – dagfr
    Commented Jun 30, 2020 at 16:29

1 Answer 1


A common reason for this error is that the blockchain that you are querying has not synchronized. Confirm with web3.eth.syncing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.