Skip to content

Instantly share code, notes, and snippets.

View dglowinski's full-sized avatar

Dariusz Glowinski dglowinski

View GitHub Profile
@dglowinski
dglowinski / web3-solc-contract-compile-deploy.js
Created December 15, 2017 11:34 — forked from tomconte/web3-solc-contract-compile-deploy.js
Compiling and deploying an Ethereum Smart Contract, using solc and web3.
const fs = require('fs');
const solc = require('solc');
const Web3 = require('web3');
// Connect to local Ethereum node
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
// Compile the source code
const input = fs.readFileSync('Token.sol');
const output = solc.compile(input.toString(), 1);