Alberto Favaro
Alberto Favaro

Reputation: 1840

Network up to date on truffle deploy

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 for build a local blockchain enviroment.

There is one thing I do not understand though.

I follow these steps:

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?

Upvotes: 6

Views: 10452

Answers (2)

fly mountain
fly mountain

Reputation: 7

deploy.js=>1_deploy.js In Truffle, deployment scripts are named with numerical prefixes to control the order in which they are executed. This prefixing system ensures that dependencies between contracts are respected during deployment. Token.sol => 1_deploy.js Presale.sol => 2_deploy.js

Upvotes: 0

Alberto Favaro
Alberto Favaro

Reputation: 1840

Like @Augusto Federico Lemble explain in the comment:

"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"

And for correct redeploy like @Adam Kipnis says use:

truffle deploy --reset

Upvotes: 27

Related Questions