Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Blockchain by (12.7k points)

Hi, guys, I've been working with solidity and truffle for a few days to develop a contract. I'm testing using the network created by Ganache an RPC client to build a local blockchain enviroment. There is one thing I do not understand though. I follow these steps:

truffle deploy. I deploy my contract on the network.

truffle test. I test my contract. It's OK.

truffle deploy. I try to update my contract. Say me "Network up to date"

But if I restart Ganache and update my contract with truffle deploy it works (this is the thing that I don't understand).

Why? Can someone explain it to me?

1 Answer

0 votes
by (29.5k points)
edited by

The issue is that you are trying to redeploy the same contract,  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.

To redeploy you should use the following:

truffle deploy --reset

Know the blockchain better through Blockchain Certification by Intellipaat.

Browse Categories

...