infura
在之前,我们使用了本地的ganache-cli测试网络+mocha测试部署交互合约。现在,我们需要使用到infura将合约部署到真实的区块链的网络当中。
我们都知道,如果我们本身不是一个以太坊的节点,那么我们就需要将我们的交易发送给其他的节点来挖矿确认。infura就是默认的维护了许多的节点,我们通过它就能够与以太坊进行连接。
安装模块
1 |
npm install --save truffle-hdwallet-provider |
利用infura部署合约
deploy.js:
1 |
const HDWalletProvider = require('truffle-hdwallet-provider'); |
部署
1 |
> node deploy.js |
本文链接: https://dreamerjonson.com/2018/12/01/solidity-59-infura-deploy/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY 4.0 CN协议 许可协议。转载请注明出处!