将智能合约部署到以太扫描网络

问题描述 投票:0回答:1

我正在尝试制作示例智能合约,并迁移到以太坊扫描浏览器,但无法部署。我正在使用松露,infura和metamask来测试我的应用程序。我能够成功编译它,但是当我尝试运行迁移时,它显示为everything is upto date, nothing to compile。我的truffle.js文件看起来像这样

    ropsten: {
      provider: function (){
        return new HDWalletProvider(mnemonic, 
        'https://ropsten.infura.io/v3/api_key')
      },
      network_id: 3,
      from: 'address',
      gasPrice: 25000000000000
    }
}
ethereum solidity smartcontracts truffle
1个回答
0
投票

如果与develop不同,则必须选择网络:

$ truffle deploy --network ropsten

请参见truffle docs

© www.soinside.com 2019 - 2024. All rights reserved.