Created
November 23, 2017 18:58
-
-
Save Qaaj/957d1eaa14e1e715bc19db6e414c1ae7 to your computer and use it in GitHub Desktop.
Displaying coinbase of Ethereum network
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
const express = require('express'); | |
const Web3 = require('web3'); | |
const app = express(); | |
const web3 = new Web3(new Web3.providers.HttpProvider("http://geth:8545")); | |
app.get('/', async (req, res) => res.send(`Coinbase: ${await web3.eth.getCoinbase()}`)); | |
app.listen(3001, () => console.log('Listening on port 3001!')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment