Created
May 16, 2018 15:45
-
-
Save johndpope/a22dcc4a78e7d305e683f6cb887fd1a1 to your computer and use it in GitHub Desktop.
This file contains 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
npm install bluebird | |
truffle console --network ganache | |
const Promise = require('bluebird'); | |
const Web3 = require('web3'); | |
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:7545")); | |
if (typeof web3.eth.getAccountsPromise === 'undefined') { Promise.promisifyAll(web3.eth, { suffix: 'Promise' });} | |
web3.eth.getBlockNumberPromise().then(_blockNumber => web3.eth.getBlock(_blockNumber)).then(_block => { return "ok" }) | |
let blockNumber = web3.eth.getBlockNumberPromise() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment