Skip to content

Instantly share code, notes, and snippets.

@Qaaj
Created November 23, 2017 18:58
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 Qaaj/957d1eaa14e1e715bc19db6e414c1ae7 to your computer and use it in GitHub Desktop.
Save Qaaj/957d1eaa14e1e715bc19db6e414c1ae7 to your computer and use it in GitHub Desktop.
Displaying coinbase of Ethereum network
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