前面讲过使用终端来部署智能合约,总的来说使用起来还是很不便,本文介绍使用web钱包来部署智能合约。
部署智能合约
上一篇文章我们也提到了web钱包的使用,这里就不再重复讲解使用方法。我们用基于星云链的智能合约与Dapp(四)——编写并运行智能合约中的智能合约为例来演示web钱包如何部署智能合约。
为了节约部署的时间,我们使用Testnet
来演示,任何环境部署和调用智能合约都需要代币。
如何获取测试网络的星云币?
通过https://testnet.nebulas.io/claim/可以获取测试环境里的星云币,获取流程参见网站的说明。


点击上图的交易哈希可以查看交易状态

已经部署成功,保存好txHash和address
txHash: 33ef9979407c68a4dfd158672f42bc77c58e804c734c60c80a7dcba2cf54a792
address: n1nXfnfP6D6eiJZBDvmLfPBseh6DNHSmiNe
所搜智能合约
我们可以使用txHash所搜刚刚部署的智能合约的源代码

执行智能合约方法
执行合约中的save
方法

执行
balanceOf
方法查询合约中的余额
提示:这个地方我们点击测试就能够直接查询到数据,不需要点击提交
执行合约中的takeout
方法

我们再次执行
balanceOf
方法查询合约中的余额
以上就是使用web钱包部署智能合约已经调用合约中方法的内容。
网友评论