I am assuming that your node is still working which we have discussed in our previous article.
2- Check the account address:
As you know the default settings of our ethereum is continuously mining the empty blocks so that way our coinbase account will receive the mining rewards. To check what is the address of the account is then write
The value or hash will be the same as what you had in your keystore folder. Previously we had created three different accounts so you can pass the value as 1 or 2 to see the addresses of other accounts.
3 – Check the balance in the account
To check the Ether amount you can simply type
The above query will return you the ether amount, but it is not in readable format. In our case, we can see that the first address has 1.308e+21 as a balance.
4 – Check the Ether balance in the account
The web3 library provides a function to see how much ethers are in the account. Just write the following command
As above image, we can see the coinbase account or miner account has 1449 Ethers, but after another empty block mined, it turns into 1452 Ethers. So it looks like our account 0 is rich enough to send some money to the account number 1.
5 – Send some ethers from account 0 (coinbase) to account 1
You will see a long hash of the transaction, which will be signed by the account (our coinbase account) and it has sent the 123 ethers to the account number 1.
6 – Check the transaction info on the private node console
Now check the running node console, and you will find the transaction which denotes as TX with the “1” as value. You can also see the utilization of the gas with the amount 21000 for this transaction. Below is the snapshot of our transaction as compared to the empty transaction underneath or before it. You can also see “from” and “to” addresses with their respective hashes.
7 – Send some ethers from account 1 to account 2
Now let’s try to send some Ethers from account 1 to account 2
Error: authentication needed: password or unlock
This error shows that the account which must be an initiator of the transaction must have proper rights or must be logged in.
Here try to understand essential technical information. Whenever any account initiates the transaction, then that particular account needs to sign the transaction by its private key. In our case, the account number 0 is a coinbase account. Secondly, it is already unlocked at the startup time of the private node.
To unlock an account just write following command followed by the password of your keystore file.
Once the account number 1 is unlocked, you can send any transaction from that account to any other account. As you can see now, 32 Ethers have been sent to account number 2.
8 – Gas charges and remaining balance
Here account number 0 is incremented with more ethers because it is a coinbase account.
But if you look at the account number 1 which had only 132 Ethers before now has 99.999622 Ethers, but the account number 2 has now 32 Ethers which were successfully sent.
Look carefully at the amount which was deducted from account number 1 which is now 32.000378 instead of 32. Because the sender must also pay the gas price, therefore, 0.000378 has been paid from account number 1.
Read the below calculation to understand the Ethers distribution.
Account 1 = 132.00 Ether Account 2 = 0 Ether Account 1 Sent 132 ether to Account 2 Account 1 paid 0.000378 Ethers for the gas charges Account 1 balance is now 99.999622
Note:- The transaction result or output will take some time to display on the console because it collects all the transactions to fill the existing block. Afterward, it will initiate the mining process. So do not worry if after the transaction you see unchanged balance like in our case it will remain zero for sometime.