1

I am trying to run a test Ethereum blockchain and I was following this tutorial How to create local multi-node private Ethereum network. At around 25 minutes, the tutor shows how to mine. Till now, I have exactly followed his steps and have successfully replicated them on my system. However, at this stage, when I run the command miner.start(1), it returns null instead of true.

Even on running eth.mining command, it shows false, indicating mining has not started yet. Neither is any DAG being created. I posed this same question to the tutor on his channel, but there doesn't seem to be any solution.

I am running geth CLI on a Ubuntu 16.04 VM allocating a 1 core CPU with RAM of 1 GB. I am not using the Mist Wallet to track ether or accounts. The JS console seems powerful enough for that. Is mining not taking place because of running of the instance on VM? Kindly help me out ASAP.

This is the genesis.json file content, just for reference.

{ "config": {

"chainId": 0, "homesteadBlock": 0, "eip155Block": 0, "eip158Block": 0 },

"nonce": "0x0000000000000042",

"timestamp": "0x00",

"parentHash": "0x000000000000000000000000000000000000000000000000000000000000$

"extraData": "0x00",

"gasLimit": "0x08000000",

"difficulty": "0x0400",

"mixhash": "0x000000000000000000000000000000000000000000000000000000000000000$

"coinbase": "0x3333333333333333333333333333333333333333",

"alloc" : {

}

}

Edit 1: Added JSON file content.

Edit 2 : Added RAM allocation in VM

1

allocating a 1 core CPU with RAM of 1 GB

I'm sorry to inform you, that this is by far not enough. ;) You need at least(!) 4GB for mining, or things won't move. 4,5 GB is a better value, just to be sure. Also a bit more CPU power won't do any harm.

  • I get that. But, for such a lesser power, the mining should be incredibly slow, right? Why am I getting null when I go for miner.start(1)? – Arghya Dutta Jun 15 '17 at 11:56
  • Hello again! Tried the same with 4GB RAM, but the problem still persists. eth.mining this time returned true but miner.start(2) still returns null and eth.hashrate and eth.blockNumber returns 0, two hours after starting the mining. The log also shows no indication of creating a DAG. – Arghya Dutta Jun 16 '17 at 8:46
  • The arg in miner.start determines how many threads / cores to use. if you assigned only one core to your machine, miner.start(2) cannot work of course. So stick to just simply miner.start, that seems to work for you. – Nikita Fuchs Jun 16 '17 at 12:17
  • Simply miner.start() also returning null, with eth.mining returning 'true', eth.blockNumber and eth.hashrate returning 0. – Arghya Dutta Jun 19 '17 at 5:06
  • If the genesis file is correct, I wonder now if there's a problem with the flags used to initiate the genesis file. I have made a shell script to initiate the file and get into console as follows: geth --identity "$4" --rpc --rpcport "$3" --rpccorsdomain "*" --datadir "/home/argo/ethereum/$1" --port $2 --nodiscover --rpcapi "db,eth,net,web3,miner" --networkid 1900 --nat "any" init "/home/argo/ethereum/genesis.json" I use different identities, RPCPort and Port for different node instances. To get into the console, I replace init "path/to/*.json with console>console.log – Arghya Dutta Jun 19 '17 at 5:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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