Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eth.hashrate always returns 0 #17601

Closed
jerryji opened this issue Sep 7, 2018 · 5 comments · Fixed by #17667
Closed

eth.hashrate always returns 0 #17601

jerryji opened this issue Sep 7, 2018 · 5 comments · Fixed by #17667
Assignees

Comments

@jerryji
Copy link

jerryji commented Sep 7, 2018

Hi there,

please note that this is an issue tracker reserved for bug reports and feature requests.

For general questions please use the gitter channel or the Ethereum stack exchange at https://ethereum.stackexchange.com.

System information

Geth version: 1.8.15-stable
OS & Version: Linux (Ubuntu 18.04 64-bit)
Commit hash : (if develop)

Expected behaviour

eth.hashrate returns some non-zero value

Actual behaviour

eth.hashrate always returns zero on my Intel Core i7-7500U laptop (512G SSD PCIe)

$ geth --testnet --port 30303 --mine --minerthreads=4 --cache=2048

net.peerCount
22
eth.hashrate
0
eth.getBlock("latest").difficulty
6042033910
eth.blockNumber
3990598
eth.getBalance(eth.coinbase)
0

Steps to reproduce the behaviour

miner.stop()
miner.start(4)
eth.hashrate

while geth has been eating 95% CPU for hours

Backtrace

N.A.

Note

Found this StackOverflow question https://ethereum.stackexchange.com/questions/51220/cpu-mining-on-testnet-using-geth-on-ubuntu-eth-hashrate-0 but it doesn't really help much

@rjl493456442 rjl493456442 self-assigned this Sep 8, 2018
@csokun
Copy link

csokun commented Sep 10, 2018

Last time I checked you have to add --metrics to your start command.

@jerryji
Copy link
Author

jerryji commented Sep 15, 2018

Thanks @csokun , --metrics does the trick (isn't much, but at least not zero :)

eth.hashrate
182016
eth.getBlock("latest").difficulty
10529606815

@markusschaeffer
Copy link

markusschaeffer commented Sep 16, 2018

Hi, experience the same problem as @jerryji .

eth.hashrate always returns 0 although --metrics is enabled.

I start geth (for a private network ) like this:
geth \ --datadir $ETH_DIR/node-$nodeIndex/ \ --identity 'node-'$nodeIndex \ --networkid "$NETWORK_ID" \ --ipcpath $node_ipcpath \ --port $portValue \ --rpc \ --rpcaddr $rpcaddrValue \ --rpcport $rpcportValue \ --rpcapi $RPCAPI \ --rpccorsdomain "*" \ --ws \ --wsaddr $wsaddrValue \ --wsport $wsportValue \ --wsapi $WSAPI \ --wsorigins "*" \ --bootnodes $bootnode_address \ --ethstats $netstats_address \ --gasprice $GAS_PRICE \ --targetgaslimit $target_gas_limit \ --unlock 0 \ --password $ETH_DIR/node-$nodeIndex/password.txt \ --etherbase 0 \ --mine \ #mining enabled --metrics \ #enabled for querying hashrate --minerthreads 8 &
Am i missing something? I can see that geth is mining and everthing works as expected apart from eth.hashrate...

@QasidLabeed
Copy link

Same thing happens with me while running a private network using Flags.
Mine got solved upon restarting the network.

1.I removed the datadir for each of the node.
2. Reinitialized genesis block for each node
3. Started each node.

Now eth.hashrate is showing some values instead of zero.

@susannaK
Copy link

1.I removed the datadir for each of the node.
2. Reinitialized genesis block for each node
3. Started each node.

I'm having the same issue & want to try your fix without accidentally destroying or deleting my accounts.
Would you mind sharing exactly how you did #1 and #2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants