1

Short Question:

Why is my node mining?

Long Question:

I just deployed Ethereum using the following information:

Genesis code

{
"config": {  
    "chainId": 7654321, 
    "homesteadBlock": 0,
    "eip155Block": 0,
    "eip158Block": 0
               },
"difficulty": "0x4000",
"gasLimit": "0x8000000",  
"alloc": {}
}
}

Set up code geth --datadir c:\blockchain init c:\genesis.json

Node startup

  geth –-identity "blockdb" –-rpc -–rpcport "8258" --rpccorsdomain "*" –-rpcapi "db,eth,net,web3" –-datadir "c:\\blockchain" –-port "30303" –-nodiscover –-networkid 7654321 console

When I create an account and do Miner.start(), it goes into a long mining cycle

enter image description here

This goes on and on. Why? The question arises because I was following this video, and his blockchain is not doing anything. Why so?

Is it possible to stop the blockchain from adding unnecessary Blocks? This should save CPU Power right?

2

1 Answer 1

0

Because that's how blockchains work: they store transactions into blocks and these blocks have to be mined.

Your node is basically generating blocks in your private blockchain. These are empty blocks (unless you issue transactions).

In conclusion, your node is doing what it's supposed to do and you can start playing with it.

3
  • I should have specified this then... I was following this video, and his blockchain is not doing anything. Why so? youtube.com/watch?v=G3fa7VCVwsc Also, does this mean that Blockchains keep adding blocks forever despite no transactions?
    – DottoreM
    Jul 17, 2018 at 14:23
  • video starts mining at 11:25, the same thing does not happen
    – DottoreM
    Jul 17, 2018 at 14:27
  • yes, miners will produce empty blocks even if there are no transactions. But, if there are no transactions, there are few chances that there will be miners to mine in your blockchain. They'd most probably move to a blockchain where they can get some rewards (valuable coins) for wasting resources (blocked hardware and electricity) Jul 17, 2018 at 14:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.