简体   繁体   English

你可以从网页部署智能合约吗?

[英]Can you deploy a smart contract from a webpage?

I am trying to deploy a smart contract from a webpage.我正在尝试从网页部署智能合约。 I am using react for frontend and I wrote a smart contract in solidity, but the contract is deployed only when I run the truffle commands in terminal.我在前端使用 react 并且我编写了一个可靠的智能合约,但是只有当我在终端中运行 truffle 命令时才会部署合约。 I want to deploy the contract when the user clicks a button.我想在用户单击按钮时部署合同。

How can I do that?我怎样才能做到这一点?

You can do a deployment transaction from frontend using web3.js or ethers.js library.您可以使用 web3.js 或 ethers.js 库从前端进行部署事务。 How to deploy a contract using these libraries, please refer to the documentation of deploy function .如何使用这些库部署合约,请参考 deploy function 的文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法将智能合约应用程序部署到 Heroku - Can't deploy smart contract application to Heroku 测试私有区块链中的代码并部署智能合约 - Testing a code from a private blockchain and deploy a smart contract 如何在同一个 javascript 程序中部署和获取智能合约的地址 - How to deploy and get address of smart contract in same javascript program 使用安全帽和 heroku 部署智能合约 - 未安装 ERR 安全帽 - Smart contract deploy with hardhat and heroku - ERR hardhat not installed 从智能合约数组中获取数据 - Fetch data from a smart contract array 错误:发送标头后无法设置标头。 来自调用智能合约功能 - Error: Can't set headers after they are sent. comes from calling the smart contract function 如何从node.js在智能合约中创建令牌? - How can I create tokens in smart contract from node.js? Hyperledger“智能合约”可以在状态下有多个集合吗? - Can Hyperledger "Smart Contract" have multiple collections at the state? 我们可以更新部署在 Hedera 测试网中的 Solidity 智能合约吗? - Can we update solidity smart contract which is deployed in Hedera TestNet? 提供默认帐户以与Nodejs中的智能合约进行交互 - Provide default account to interact with smart contract from Nodejs
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM