In order to know last block hash in bitcoin I can just call

bitcoin-cli getbestblockhash

from command line.

Is there something like that in ethereum or I should use RPC and curl?

1 Answer 1


When your node is running, you can use:

 geth --exec 'eth.getBlock(eth.blockNumber).hash' attach

If it is not running, then there is no way to be synchronized, so you cannot get this information.

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.