3.2.2 部署到测试网补充

feng 2022-10-15 19:23:40
Categories: Tags:

1、安装truffle/hdwallet-provider

npm install @truffle/hdwallet-provider

如果报错,试试以下

npm i @truffle/hdwallet-provider@next

2、在 truffle-config.js 文件配置huobi测试网参数

hecotest:{
    provider: () => new HDWalletProvider
        (['私钥'],  
        'https://http-testnet.hecochain.com'),
        netword_id: '256',
    },

3、然后再编译

truffle compile

4、部署

truffle migrate --network hecotest

5、上

在测试网上,通过上一步部署完的地址
可以在 https://testnet.hecoinfo.com/ 查到部署的合约地址