我被困在一个问题,因为无法部署信托合同到Rinkeby网络!如图所示,它使用的是网络“开发”?为什么?我要林克比!
ASMAHANs-MacBook-Pro:project-6 asmahan$ truffle compile
ASMAHANs-MacBook-Pro:project-6 asmahan$ truffle migrate network rinkeby
Using network 'development'.
Network up to date.我确保我安装了web3,松露,呋喃和MetaMask。这是truffle.js文件
const HDWalletProvider = require("truffle-hdwallet-provider");
module.exports = {
networks: {
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*" // Match any network id
},
rinkeby: {
provider: function () {
return new HDWalletProvider("mus***********tuff sustain",
"rinkeby.infura.io/v3/********")
},
network_id: '4',
gas: 4500000,
gasPrice: 10000000000,
}
}
};发布于 2019-03-29 16:37:39
松露的网络选项没有以正确的方式编写。根据https://truffleframework.com/docs/truffle/reference/truffle-commands#compile,正确的语法是:
-网络:指定要使用的网络,保存特定于该网络的工件。网络名称必须存在于配置中。
所以您的命令行应该是:truffle migrate --network rinkeby
https://ethereum.stackexchange.com/questions/69041
复制相似问题