0

As per the instructions detailed in this post, I've created an account:

enter image description here

and started running my geth node:

enter image description here

how can I check if it's mined any ether yet?


the answer of @lungj resulted in this:

enter image description here

1 Answer 1

1

You can use this from the geth console:

web3.fromWei(eth.getBalance(eth.coinbase), "ether")

It shows you the balance, in ether, of the account you are mining to. If it's not zero, either you've been sent some ether or you've mined some! Alternately, you can use this script which shows you the balance for all accounts:

function checkAllBalances() {
    var totalBal = 0;
    for (var acctNum in eth.accounts) {
        var acct = eth.accounts[acctNum];
        var acctBal = web3.fromWei(eth.getBalance(acct), "ether");
        totalBal += parseFloat(acctBal);
        console.log("  eth.accounts[" + acctNum + "]: \t" + acct + " \tbalance: " + acctBal + " ether");
    }
    console.log("  Total balance: " + totalBal + " ether");
};

See also https://github.com/ethereum/go-ethereum/wiki/Managing-your-accounts

I don't think you need to unlock your account to execute this.

4
  • so- I tried it out- but it didn't work- did I do it right? put the attempt in an OP edit, is it right that I can just run that command in a second console window plugged into the same client with the following command (on OSX) geth console --port "35555" Jul 24, 2017 at 22:00
  • Can you try replacing eth.coinbase with your Ethereum address (0xd7a9...) which is listed as your coinbase?
    – lungj
    Jul 25, 2017 at 0:01
  • yep, did this one web3.fromWei(web3.eth.getBalance('0xd7a9a61a480d458a1181e0563b07f944df4489a6'),'ether').toString(10) and it worked. can I query any address on there? even one of yours or anyones? Jul 25, 2017 at 0:04
  • 1
    You sure can! .
    – lungj
    Jul 25, 2017 at 1:31

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.