Skip to content

Instantly share code, notes, and snippets.

@MeiyappanKannappa
Created January 17, 2021 10:48
Show Gist options
  • Select an option

  • Save MeiyappanKannappa/f4632efe4450c3ccf16c8501fd179edd to your computer and use it in GitHub Desktop.

Select an option

Save MeiyappanKannappa/f4632efe4450c3ccf16c8501fd179edd to your computer and use it in GitHub Desktop.
// SMART CONTRACT CONFIG
let fs = require("fs");
let Web3 = require('web3'); // https://www.npmjs.com/package/web3
// Create a web3 connection to a running geth node over JSON-RPC running at
// http://localhost:7545
let web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider('http://localhost:7545'));
let source = fs.readFileSync("chocolavabank.json");
let contracts = JSON.parse(source);
//SMART CONTRACT CONFIG ENDS
var myContract = new web3.eth.Contract(contracts.abi, <CONTRACTS_ID>, {
from: <ACCOUNT_ID>, // default from address
gasPrice: '3000000' // default gas price in wei, 20 gwei in this case
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment