1

I'm confused as to the distinction between a migration (in truffle) and a fork (project, not ethereum). After the initial migration (deploy), any future migrations create new contracts with new addresses, while all of the old contracts are still alive and clients can connect to them. That seems like a fork to me, or am I missing something?

I also wonder if there established architectural patterns for avoiding forks. For example is it considered a good practice to replace constants with ethereum variables, and expose getter/setter functions for those?

2

A Truffle Migration Simply Means that you are deploying the compiled contracts on the the Ethereum blockchain (The mainchain or any Testnet or Testrpc)

This deploying of contracts is treated as a transaction and has to be added into a block ie Verified (not in the real sense) by Miners.

Yes in a way it is a kind off fork of the project, but usually whenever changes are made in the project and they are deployed, the old contracts are killed first using the selfdestruct() function and then the modified contract is deployed.

Hope this answered your question.

  • Thank you for your response. However what about subsequent migrations? The old contracts are still deployed, right? And they are still accessible by clients, right? So isn't that actually a fork of my project? (I edited the question to be more specific about follow up migrations.) – mjhm Jan 7 '18 at 21:11
  • Yes in a way it is a kind off fork of the project, but usually whenever changes are made in the project and they are deployed, the old contracts are killed first using the selfdestruct() function and then the modified contract is deployed. Hope this helps:) – Sharan Rajani Jan 9 '18 at 11:41
  • Thanks Sharan -- that makes much more sense now. If you edit your answer with to include this comment, I'll accept it. – mjhm Jan 9 '18 at 15:59
  • Sure i'll do it immediately. – Sharan Rajani Jan 11 '18 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.