go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  Step 5. Deploy the contract
 
Subject: Step 5. Deploy the contract
Author: WebSpider
In response to: Step 4: Prepare the contract for deployment
Posted on: 06/07/2021 07:07:41 AM


    	// account used for connection    
	let accounts = await web3_conn.eth.getAccounts();

	// deploy
	const newContractInstance = await contract.send({
            from: accounts[0],
            gas: 1500000,
            gasPrice: '30000000000'
        });
		
        console.log('Contract deployed at address: ', newContractInstance.options.address);


 

> On 06/07/2021 07:05:27 AM WebSpider wrote:

	var CONTRACT = require("./CONTRACT");
	const ABI = CONTRACT.ABI;              // from complied contract's "abi"
	const BYTECODE = CONTRACT.BYTECODE;    // from complied contract's "data.bytecode.object"
        const CONTRACTOR_ARGS = []; 

        let contract = new web3_conn.eth.Contract(ABI);  
    
        contract = contract.deploy({
            data: BYTECODE,
            arguments: CONTRACTOR_ARGS
        });





References:

 


 
Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
 
Get your own forum today. It's easy and free.