当我在终端中运行truffle migrate --network kovan时,契约部署不会运行。只是:
Compiling your contracts...==================== >Eveything is up to date, there is nothing to compile
下面是我的块菌-config.js代码:
require('babel-polyfill');
require('dotenv').config();
const HDWalletProvider = require('truffle-hdwallet-provider-privkey');
const privateKeys = process.env.PRIVATE_KEYS || ""
module.exports = {
networks: {
development: {
host: "127.0.0.1",
port: 7545,
network_id: "*" // Match any network id
},
kovan: {
provider: function(){
return new HDWalletProvider(
privateKeys.split(','),
'https://kovan.infura.io/v3/${process.env.INFURA_API_KEY}'
)
},
gas: 5000000,
gasPrice: 25000000000,
network_id: 42
}
},
contracts_directory: './src/contracts/',
contracts_build_directory: './src/abis/',
compilers: {
solc: {
optimizer: {
enabled: true,
runs: 200
}
}
}
}发布于 2020-11-28 15:01:18
删除构建目录为我做了这件事。在那之后它正确地重新部署了我的合同。
发布于 2020-11-28 16:08:15
您已经编译并部署了您的智能契约。当您尝试两次部署相同的契约时,消息Eveything is up to date, there is nothing to compile会在迁移过程中发生。
如果要将合同重新部署到新地址,可以使用--reset标志:
truffle migrate --network kovan --reset发布于 2022-01-06 21:23:55
您可以尝试这个命令;它对我有效,并且不要忘记为您的Ethereum帐户提供资金:
truffle migrate --network=kovan --skip-dry-runhttps://ethereum.stackexchange.com/questions/72825
复制相似问题