0

I have a very simple migration script, and I believe I did nothing wrong.

var Migrations = artifacts.require("./Migrations.sol");
var HW = artifacts.require("./HelloWorld.sol");

module.exports = function(deployer) {
    deployer.deploy(Migrations);
    deployer.deploy(HW);
};

However, truffle migrate just doesn't want to deploy without the --reset option.

I have even tried to do migrate without compile, and truffle do aware that my HelloWorld.sol had been changed, and compile automatically. But it just doesn't want to deploy.

  • 1
    i have this issue too, when using local ganache-cli node. truffle always check the network version and then doesn't deploy. i always had to restart ganache-cli and do the truffle migrate command. it worked that way. – Kaki Master Of Time Feb 28 '18 at 9:48
2

It is what truffle migrate do, as its doc said. It will deploy the contract based on the deploy files, like 2_deploy_HelloWorld.js. If you want to update some contract after editing, you can create another deploy file, redeploy the contract, update some contract state data, etc.
If you just want to re-deploy, then just add '--reset' will be fine.

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.