Created
January 17, 2021 10:48
-
-
Save MeiyappanKannappa/f4632efe4450c3ccf16c8501fd179edd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // 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