简体   繁体   中英

How to prevent deploying contract from quorum node

In quorum.network, every node can deploy smart contract. How can I prevent the node from deploying smart contract or allow only specific node to do this.

Thank.

You can use "privateFor" field while deploying contract.In privateFor object pass the publicKey of participant node. Please refer below code:

web3.eth.contract(contract.abi).new({
            data: "0x" + contract.bytecode,
            gas: 80000000,
            privateFor: ["bvpFyZCYmtPX3hyxNhmPXu0Rn/95S3IoqyK+IiZPlHw="],
            from: owner,
        }

Thanks,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM