【发布时间】:2021-05-22 16:36:14
【问题描述】:
我的情况有点奇怪..我能够将我的合同部署到本地 Ganache 实例:
松露迁移——网络开发
但是,现在当我对合同进行任何更改并运行相同的命令时,我的合同会被编译,但最后我得到了
网络是最新的
现在我不确定为什么会这样?合约不一样,虽然我只改了几行代码和参数,返回值都一样,难道是这个原因吗?
另外,我认为它适用于:
松露部署 --reset
但是我明白了:
Compiling your contracts...
===========================
Everything is up to date, there is nothing to compile.
Something went wrong while attempting to connect to the network. Check your network configuration.
Could not connect to your Ethereum client with the following parameters:
- host > 127.0.0.1
- port > 7545
- network_id > 5777
现在当我使用 --reset 选项运行命令时尝试使用端口 7545 很奇怪......因为我的 truffle-config 指向端口 8545:
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
contracts_build_directory: path.join(__dirname, "client/src/contracts"),
networks: {
develop: {
host: "127.0.0.1",
port: 8545,
network_id: "*",
}
},
// Configure your compilers
compilers: {
solc: {
version: "0.8.4", // Fetch exact version from solc-bin (default: truffle's version)
}
}
},
};
我之前确实在 7545 上运行过 Ganuche 作为实验,但它已经有一段时间没有在该端口上运行了,并且
松露迁移——网络开发
能够连接并执行初始迁移。只是现在它不会选择任何新的更改。有什么想法吗?
【问题讨论】:
标签: blockchain solidity smartcontracts truffle contract