Search code examples
blockchainethereumgeth

ethereum miner not giving ether to coinbase account


I am relatively new to Ethereum. I was trying to set up a private test network. I used the following genesis file: { "config": { "chainId": 15, "homesteadBlock": 0, "eip155Block": 0, "eip158Block": 0 }, "difficulty": "20", "gasLimit": "2100000", "alloc": { "7df9a875a174b3bc565e6424a0050ebc1b2d1d82": { "balance": "300000" }, "f41c74c9ae680c1aa78f42e5647a62f353b7bdde": { "balance": "400000" } } } The following commands were used to initialise and start the network:

geth --datadir "C:\Users\Mahe\Desktop\Ethereum\data" init "Path_to_genesis"

geth --datadir "C:\Users\Mahe\Desktop\Ethereum\data" --nodiscover --networkid 65535 --port 60303 --rpc --rpccorsdomain "*" --rpcapi "web3,eth,personal,miner" console 2>Node2.log

The network started successfully, after which I created a new account and set it as coinbase. eth.coinbase is set and gives the address of the created account. However, there is no increase of ether in the created account upon mining(eth.getBalance(eth.accounts[0]) returns 0). Any help would be appreciated.


Solution

  • The issue was that the blocks were not getting mined quickly. The first block was mined after 20 minutes of miner.start(), after which the block generation speed shortened. The balance in the Coinbase account started increasing when blocks were mined successfully.