如何在conflux上部署合约
source link: https://igaojin.me/2019/12/03/%E5%A6%82%E4%BD%95%E5%9C%A8conflux%E4%B8%8A%E9%83%A8%E7%BD%B2%E5%90%88%E7%BA%A6/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
如何在conflux上部署合约
在 https://remix.ethereum.org/ 上面编写好合约
编译好了就可以拿到ABI 以及 Bytecode了.(后面用)
创建conflux 地址
有好几种方式,因为conflux地址是与eth兼容的,所以你可以直接使用你的eth地址
当然也可以使用官方的js,或者在线钱包
打开https://wallet.confluxscan.io/wallet就可以创建了
本地js创建(推荐,因为后面部署合约也需要用到
先下载github repo并初始化
git clone https://github.com/jin10086/confluxBuildContract.git |
直接执行 node createAccount.js
就创建好了
(base) ➜ confluxBuildContract git:(master) ✗ node createAccount.js |
领取测试代币
因为新地址是没有代币的,所以需要先领取
直接浏览器打开 https://wallet.confluxscan.io/faucet/dev/ask?address=你的pub_key
就可以领取了
- 把
deployContract.js
里面的pub_key priv_key
改成刚才生成的公钥以及私钥 - 把
deployContract.js
里面的abi bytecode
改成在remix生成的 - 执行
node deployContract.js
就可以部署合约了
部署返回结果如下
(base) ➜ confluxBuildContract git:(master) ✗ node deployContract.js |
可以在http://www.confluxscan.io/ 上查看刚刚部署成功的合约
本文作者:高金
本文地址: https://igaojin.me/2019/12/03/如何在conflux上部署合约/
版权声明:转载请注明出处!
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK