Error
'Error: Account does not exist or account balance too low'
Overview
I'm trying to deploy the greeter smart contract in the ethereum.org/greeter tutorial. I downloaded/validated the blockchain history. Etherscan shows there's 0.05 ETH in my account but when I check the balance in geth console using the steps below it says 0 ETH.
Account with .05 ETH https://etherscan.io/address/0xf074d2b114e8c15e19503288f4ce5fd641bc0fdd
Transaction 0xeebffdaceef818dcc37d59757d707cc7ddc3d1f9cb84965842f1fdb6c379638e
Block 4058263
Terminal1:
Show that my account in my ethereum geth node doesn't have a balance:
geth --rpc --rpcaddr "127.0.0.1" --rpcport "8545" --fast --cache=2048 console
> personal.unlockAccount("f074d2b114e8c15e19503288f4ce5fd641bc0fdd", "my_password") true
> web3.eth.getBalance("f074d2b114e8c15e19503288f4ce5fd641bc0fdd");
0
But the array that this command outputs contains my transaction
> web3.eth.getBlock(4058263).transactions
[huge array of transactions, including 0xeebffdaceef818dcc37d59757d707cc7ddc3d1f9cb84965842f1fdb6c379638e]
So my local history shows that this transaction took place right? I wonder why the account balance isn't updated when I run the above commands. Its almost as if I need an account update command (I found one but its only for resetting password) that says, "Check the history to see if anyone sent me ether".
Terminal2:
node myFirstSolidityContract.js
Error: Account does not exist or account balance too low at Object.InvalidResponse (/Users/WillsHome/Projects/node_modules/web3/lib/web3/errors.js:38:16) at /Users/WillsHome/Projects/node_modules/web3/lib/web3/requestmanager.js:86:36 at XMLHttpRequest.request.onreadystatechange (/Users/WillsHome/Projects/node_modules/web3/lib/web3/httpprovider.js:118:13) at XMLHttpRequestEventTarget.dispatchEvent (/Users/WillsHome/Projects/node_modules/xhr2/lib/xhr2.js:64:18) at XMLHttpRequest._setReadyState (/Users/WillsHome/Projects/node_modules/xhr2/lib/xhr2.js:354:12) at XMLHttpRequest._onHttpResponseEnd (/Users/WillsHome/Projects/node_modules/xhr2/lib/xhr2.js:509:12) at IncomingMessage. (/Users/WillsHome/Projects/node_modules/xhr2/lib/xhr2.js:469:24) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12)
myFirstSolidityContract.js Code
var Web3 = require('web3')
web3 = new Web3();
web3.setProvider(new
web3.providers.HttpProvider("http://localhost:8545"));
var solc = require('solc');
var greeterSource = 'contract mortal { address owner; function mortal()
{
owner = msg.sender; } function kill() { if (msg.sender == owner)
selfdestruct(owner); } } contract greeter is mortal { string greeting;
function greeter(string _greeting) public { greeting = _greeting; }
function greet() constant returns (string) { return greeting; }
}'
console.log('\n ===== my account ========', web3.eth.accounts[3])
// f074d2b114e8c15e19503288f4ce5fd641bc0fdd
var greeterCompiled = web3.eth.compile.solidity(greeterSource)
var _greeting = "Hello World!"
var greeterContract =
web3.eth.contract(greeterCompiled.greeter.info.abiDefinition);
console.log('\n ====== going to deploy ======') // last thing that logs
// throws error 'Account does not exist or account balance too low'
var greeter = greeterContract.new(_greeting,{from:web3.eth.accounts[3],
data: greeterCompiled.greeter.code, gas: 300000}, function(e, contract)
{
console.log('\n ==== deployed? ====') // does not log
if(!e) {
if(!contract.address) {
console.log("Contract transaction send: TransactionHash: " + contract.transactionHash + " waiting to be mined...");
} else {
console.log("Contract mined! Address: " + contract.address);
console.log(contract);
}
} else {
console.log('\n ====== error ====== \n', e)
}
})