Created
January 30, 2019 17:25
-
-
Save avtehnik/10a88d891e840ba8168fcdba74339826 to your computer and use it in GitHub Desktop.
Web3 simple example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Web3 = require('web3'); | |
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:7545")); | |
var balance = 0; | |
web3.eth.getBalance('0xfb71B55C0C526638e1d6b3DA7598a1b3785d30f8', function(err, wei) { | |
balance = web3.utils.fromWei(wei, 'ether') | |
console.log(balance); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment