[Ethereum] Why is geth always returning a 0 balance

go-ethereumnodes

I installed geth on a remote server (Ubuntu 14.04) and created an account. I transferred 0.01 eth to the account. From my local machine (OS X), I can view the transaction and account balance correctly with web3.

However, if I log into the server and try to get the balance, it returns 0. In fact, trying to check the balance, or get info on anything returns 0. It's almost like my node is not connected, by it says I have 8 peers (and I've listed them and they look legit).

To recap, running the following on my home computer returns "0.01":

web3.fromWei(web3.eth.getBalance('0x7cacf18f931259c30a7194fa96ab3a44c38b3535'),'ether').toString(10)

As of this writing, that is correct.

However, running the same command, or even web3.eth.getBalance(web3.eth.coinbase) always returns 0 on my server. In fact, trying to get info on anything on the public chain fails (including contracts).

I'm trying to get a simple Dapp deployed, but getting a node up and running is driving me crazy!

For reference, I have ethereum/geth v. 1.3.3 installed. I've also tried 1.4-unstable. I've tried a variety of methods to start geth, and have no idea why it can't get info from the public chain.

Best Answer

It sounds like geth is not yet synced up.

Please type this into your geth console:

eth.getBlock("latest").number

As of this post, you should get 894332 or higher.

I get the correct output on my geth console.

> web3.fromWei(web3.eth.getBalance('0x7cacf18f931259c30a7194fa96ab3a44c38b3535'),'ether').toString(10)
"0.01"
Related Topic