Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在仲裁网络中,每个节点都可以部署智能合约。如何阻止节点部署智能合约或仅允许特定节点执行此操作。
感谢。
您可以在部署合约时使用“privateFor”字段。在 privateFor 对象中传递参与者节点的 publicKey。请参考以下代码:
web3.eth.contract(contract.abi).new({ data: "0x" + contract.bytecode, gas: 80000000, privateFor: ["bvpFyZCYmtPX3hyxNhmPXu0Rn/95S3IoqyK+IiZPlHw="], from: owner, }
谢谢,