CLI: Just can't figure out how to check balance :( Despite mining getBalance returns only ZERO???

mikmik Posts: 57Member ✭✭
edited May 2015 in Geth - Go Implementation
Sorry for double post, but I think I posted in wrong thread.

I created a wallet address and start the CLI with following command:
  user@ubuntu$ geth --unlock=primary --loglevel=3 --maxpeers=50 --etherbase "primary" console
I enter my pwd and start mining:
  > admin.miner.start()
I get a hashrate of around 730, which proves to me it's hashing. I also get messages like the following, which seems to indicate I mined a block that should contain some test-eth blockreward, am I right?:
  I0430 07:12:14.756338    2754 worker.go:324] commit new work on block 206492 with 0 txs & 0 uncles
  I0430 07:12:25.930185    2754 chain_manager.go:605] imported 1 block(s) 0 queued in 4.449108ms. #206492 [3231347b / 3231347b]
  I0430 07:12:25.930244    2754 worker.go:193] Mined block #206492
I check the balance with following command:
  > eth.getBalance(0x13bf27ad7781e484a0c68752f3bc949cf4262158) 
  '0' 
Is this the correct way to check balance, since the balance just remains at '0'?
Since I tried this for a couple of days now, I think there should be enough confirmations to add balance to my address, shouldn't it?

Comments

  • mikmik Posts: 57Member ✭✭
    Hi,

    sorry to bother you, but I don't know if I found the right answer on the forum already and do it right, cause the balance of my ether address doesn't change while mining!?

    I created an primary address and start the miner in that way:
      user@ubuntu$ geth --unlock=primary --loglevel=3 --maxpeers=50 --etherbase "primary" console
    
    I enter my pwd and run following command in the CLI:
      > admin.miner.start() #btw - here, it starts generating a new DAG, every time time after a reboot, why?
    
    I get a hashrate of around 730, which proves to me it's hashing and I regularly get messages like this, which seems to indicate I mined a block that should contain some test-eth blockreward, am I right?:
      I0430 07:12:14.756338    2754 worker.go:324] commit new work on block 206492 with 0 txs & 0 uncles
      I0430 07:12:25.930185    2754 chain_manager.go:605] imported 1 block(s) 0 queued in 4.449108ms. #206492 [3231347b / 3231347b]
      I0430 07:12:25.930244    2754 worker.go:193] Mined block #206492
    
    Since I tried this a couple of days now, I think there should be enough confirmations to add balance to my address.

    I check the balance with following command:
      > eth.getBalance(0x13bf27ad7781e484a0c68752f3bc949cf4262158) 
      '0' 
    
    Is this the correct way to check my balance, since the balance never changes? Thanks for help!
  • mids106mids106 Posts: 188Member ✭✭✭
    Try specifying your address as string (or use eth.coinbase):
    > eth.getBalance(eth.coinbase)
    '141808934035715362224'
    Every time you reboot Linux your /tmp directory (which is where the DAG is stored) is cleaned up.
  • tgerringtgerring Posts: 28Member ✭✭
    Hey @mik,

    Type putting the account number in quotes (single or double). For example:
    > eth.getBalance("0x13bf27ad7781e484a0c68752f3bc949cf4262158")
    You'll notice that the addresses are printed in a collection as quoted strings:
    > eth.accounts
    ['0x13bf27ad7781e484a0c68752f3bc949cf4262158']
    This is the same when checking your coinbase:
    > eth.coinbase
    '0x13bf27ad7781e484a0c68752f3bc949cf4262158'
    Which allows you to chain commands like so:
    > web3.fromWei(eth.getBalance(eth.coinbase), "ether")
    
  • StephanTualStephanTual London, EnglandPosts: 1,282Member, Moderator mod
  • mikmik Posts: 57Member ✭✭
    edited May 2015
    Thanks a lot guys! You were of great help!!! :smiley:
  • motoaddictmotoaddict Fort Myers, FloridaPosts: 52Member
    edited July 2015
    Could someone explain the following:
    ubuntu@geth:~$ geth attach
    instance: Geth/v0.9.36/linux/go1.4.2
     datadir: /mnt/ethdb
    coinbase: 0x4aed8f852020e7596da9ac7f6f0b562864c48bb2
    at block: 782624 (2015-07-03 17:27:53)
     modules: admin:1.0 db:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 shh:1.0 txpool:1.0 web3:1.0
    > eth.coinbase
    '0x4aed8f852020e7596da9ac7f6f0b562864c48bb2'
    > eth.getBalance(eth.coinbase)
    '0'
    > eth.getBalance('0x4aed8f852020e7596da9ac7f6f0b562864c48bb2')
    '0'
    > eth.getBalance()
    '1000000000000000000279477774710998425692940'
    > 
    .... why do I only see a balance with "eth.getBalance()"??

    I'm kind of stuck until I can understand this. The example js script "balance.html" (https://github.com/ethereum/web3.js) always returns a zero balance.
    Post edited by StephanTual on
  • obscurenobscuren Posts: 38Member ✭✭
    edited July 2015
    1. Your account 0x4aed8f852020e7596da9ac7f6f0b562864c48bb2 has no funds;
    2. eth.getBalance() defaults to the empty hash 00000...00. It so happens that someone (actually a few people) mined in to the void (ether!? (-:) by mining to the default 00000...00 address.
  • index932index932 Posts: 10Member
    edited September 2015
    Hi, Does these look like valid mining entires?
    I0910 19:17:42.148114 862 chain_manager.go:661] imported 1 block(s) (0 queued 0 ignored) including 4 txs in 152.558316ms. #215946 [1d7eac84 / 1d7eac84]
    I0910 19:17:42.171990 862 worker.go:540] commit new work on block 215947 with 0 txs & 0 uncles. Took 9.348232ms

    I keep getting zero balance when I check my balance using all methods.

    > eth.getBalance(eth.coinbase)
    0

    used also the address instead of eth.coinbase with single and double quotes to get only the syntax error.

    (anonymous): Line 1:16 Unexpected token ILLEGAL (and 3 more errors)
    invalid address

  • c_kletzerc_kletzer Posts: 3Member
    This still does not work for me.. I bought some ether with bitcoin and they show up on etherchain, but they do not show via getBalance... what am I missing?


    Ether shows up on etherchain:





    But not in console:



  • DoDoFruitCakeDoDoFruitCake MarsPosts: 2Member
    I'm also having this issue:

    > eth.getBalance("0xd694dda8677acf9168b36ee3eca157bfda55d077");
    0
    > eth.getBalance(eth.coinbase)
    0
    > web3.fromWei(eth.getBalance(eth.coinbase), "ether")
    0

    Any Ideas?
  • ldrapeauldrapeau Posts: 89Member
    edited March 2016
    Hi,

    Assuming you have geth running in the background, this little script should print your balance at the linux prompt.
    #!/bin/bash
    cat <<EOF | geth attach | sed -n -r  's/^([0-9\.]+)$/\1/p'
    web3.fromWei(eth.getBalance(eth.coinbase), "ether")
    exit
    EOF
  • pretoriano1000pretoriano1000 Posts: 1Member
    Hello, I can get my balance but I dont know how to interpret the number that returns me
  • EtherionEtherion Posts: 95Member
    I have the same problem. Running geth-console.bat on windows

    > eth.getBalance("0x7fa62e50ffa9bd556c15ff4447526ae1b641aa36")
    0
    > eth.getBalance(eth.coinbase)
    0

    but https://etherchain.org/account/0x7fa62e50ffa9bd556c15ff4447526ae1b641aa36 shows 3

    I want to send the 3 to an exchange. but when using command:

    eth.sendTransaction({from:eth.accounts[0], to:"0x4e12b112140dab9dc3fa9dfdce7df645dfc323d4", value: web3.toWei(3.0006361678, "ether")})

    I get the following response:
    Please unlock account 7fa62e50ffa9bd556c15ff4447526ae1b641aa36.
    Passphrase:
    Account is now unlocked for this session.
    Account does not exist or account balance too low
    at InvalidResponse (:-81662:-136)
    at send (:-156322:-136)
    at sendTransaction (:-133322:-136)
    at :1:1

    Any suggestion how to transfer the funds from the account 7fa62e50ffa9bd556c15ff4447526ae1b641aa36?
  • mspancmspanc Posts: 1Member
    Hey guys, I have the same issue

    > eth.accounts
    ["0x3de13efefeff878487b89fbaa3b30f19f1349295"]
    > personal.unlockAccount("0x3de13efefeff878487b89fbaa3b30f19f1349295", ...)
    true
    > eth.getBalance(eth.coinbase)
    0

    no ports are blocked in my network

    I am mining for a while, this is the sample log from ethminer

    miner 21:44:21.121|ethminer Mining on PoWhash #892b915e… : 2621440 H/s = 1310720 hashes / 0.5 s
    miner 21:44:21.622|ethminer Mining on PoWhash #892b915e… : 3145728 H/s = 1572864 hashes / 0.5 s
    miner 21:44:22.123|ethminer Mining on PoWhash #892b915e… : 3145728 H/s = 1572864 hashes / 0.5 s
    miner 21:44:22.624|ethminer Mining on PoWhash #892b915e… : 3145728 H/s = 1572864 hashes / 0.5 s
    miner 21:44:23.125|ethminer Mining on PoWhash #892b915e… : 3145728 H/s = 1572864 hashes / 0.5 s
    miner 21:44:23.625|ethminer Mining on PoWhash #892b915e… : 3145728 H/s = 1572864 hashes / 0.5 s
    miner 21:44:23.626|ethminer Got work package:
    miner 21:44:23.626|ethminer Header-hash: 5686de41c7c3e2914d8e6cda1864a546d0f71f0fdbb44c68910d3b579ba109cf
    miner 21:44:23.626|ethminer Seedhash: 0d8c40ac47b0766b970fa2a1bcf7c81e6001e0b58896756e343d121e8a35399d
    miner 21:44:23.626|ethminer Target: 00000000000503c2f028e0516e861fd6d4d5fc92278a920fcefc8db5ee502bb0
    ℹ 21:44:23.708|gpuminer0 workLoop 1 #0d8c40ac… #0d8c40ac…
    miner 21:44:24.208|ethminer Mining on PoWhash #5686de41… : 2097152 H/s = 1048576 hashes / 0.5 s
    miner 21:44:24.709|ethminer Mining on PoWhash #5686de41… : 3145728 H/s = 1572864 hashes / 0.5 s
    miner 21:44:25.210|ethminer Mining on PoWhash #5686de41… : 3145728 H/s = 1572864 hashes / 0.5 s
    miner 21:44:25.711|ethminer Mining on PoWhash #5686de41… : 3145728 H/s = 1572864 hashes / 0.5 s
    miner 21:44:26.212|ethminer Mining on PoWhash #5686de41… : 3145728 H/s = 1572864 hashes / 0.5 s
    miner 21:44:26.712|ethminer Mining on PoWhash #5686de41… : 3145728 H/s = 1572864 hashes / 0.5 s
    and this is from geth

    I0629 21:43:57.576394 core/blockchain.go:964] imported 1 block(s) (0 queued 0 ignored) including 13 txs in 9.586413ms. #1794769 [f6e09772 / f6e09772]
    I0629 21:43:57.589850 miner/worker.go:555] commit new work on block 1794770 with 7 txs & 0 uncles. Took 13.310414ms
    I0629 21:43:59.974208 core/blockchain.go:964] imported 1 block(s) (0 queued 0 ignored) including 7 txs in 13.313237ms. #1794770 [a0400c40 / a0400c40]
    I0629 21:43:59.974773 miner/worker.go:555] commit new work on block 1794771 with 0 txs & 0 uncles. Took 368.213µs
    I0629 21:44:07.110796 core/blockchain.go:964] imported 1 block(s) (0 queued 0 ignored) including 0 txs in 2.093932ms. #1794771 [9a83f26c / 9a83f26c]
    I0629 21:44:07.111668 miner/worker.go:555] commit new work on block 1794772 with 1 txs & 0 uncles. Took 718.83µs
    I0629 21:44:23.307491 core/blockchain.go:964] imported 1 block(s) (0 queued 0 ignored) including 1 txs in 2.625022ms. #1794772 [67ed0acb / 67ed0acb]
    I0629 21:44:23.312361 miner/worker.go:555] commit new work on block 1794773 with 7 txs & 0 uncles. Took 4.674169ms
    I0629 21:44:34.108722 core/blockchain.go:964] imported 1 block(s) (0 queued 0 ignored) including 4 txs in 4.851216ms. #1794773 [bb0996aa / bb0996aa]
    I0629 21:44:34.112218 miner/worker.go:555] commit new work on block 1794774 with 8 txs & 0 uncles. Took 3.380002ms
    What can be the reason?
  • g99g99 Posts: 10Member
    Same problem here. Left my rig on for many hours and it is still 0
  • BetroHakalaBetroHakala Posts: 2Member
    Same here - 0. Been mining for days to ethermine.org. I Grabbed the Etherium folder and synced with my gaming rig - still 0. Is there a low limit that wouldn't show - like under 1?
  • kuku3413kuku3413 Posts: 2Member
    I have the same problem. How did you solve it ?
    Thanks
Sign In or Register to comment.