Skip to content

Instantly share code, notes, and snippets.

@sontuphan
Last active February 23, 2018 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sontuphan/0a93559f77b74f7ddbe0248609691f87 to your computer and use it in GitHub Desktop.
Save sontuphan/0a93559f77b74f7ddbe0248609691f87 to your computer and use it in GitHub Desktop.
var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
console.log("\n===========================================");
console.log("========== Geth connected:", web3.isConnected(), "===========");
console.log("===========================================\n");
var Geth = function () {}
Geth.getStateRoot = function (blockNumber) {
return console.log('stateRoot:', web3.eth.getBlock(blockNumber).stateRoot);
}
module.exports = Geth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment