7 Commands of Deployment

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

7 Commands of Deployment

11. node

12. Web3 = require('web3')

13. web3 = new Web3("http://localhost:8545")

14. web3.eth.getAccounts(console.log)

15. bytecode = fs.readFileSync('Bank_sol_Bank.bin').toString()

16. abi = JSON.parse(fs.readFileSync('Bank_sol_Bank.abi').toString())

17. deployedContract = new web3.eth.Contract(abi)

deployedContract.deploy({

data: bytecode}).send({

from: '0x10b3FF63bAE49bB6D4A46d43676F3167532C6F06',

gas: 1500000,

gasPrice: web3.utils.toWei('0.00003', 'ether')

}).then((newContractInstance) => {

deployedContract.options.address = newContractInstance.options.address

console.log(newContractInstance.options.address)

});

You might also like