网络在 truffle 部署上保持最新

Network up to date on truffle deploy

我已经与 soliditytruffle 合作了几天以制定合同。我正在测试使用 Ganache 创建的网络和 RPC 客户端来构建本地区块链环境。

有一件事我不明白。

我遵循以下步骤:

但是,如果我重新启动 Ganache 并使用 truffle deploy 更新我的合同,它就会起作用。这是我不明白的地方。

为什么?有人可以给我解释一下吗?

喜欢@Augusto Federico Lemble 在评论中解释:

"If you are doing that the contracts are deployed in your private ganache network, and I guess if you try to deploy the same contract again it without changes it wont let you because you will deploy contract that is the same as the one you deployed before"

为了像@Adam Kipnis 所说的那样进行正确的重新部署,请使用:

truffle deploy --reset