0

When i run truffle migrate --network ropsten i don't see the contract deployment but just

Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.

i don't know why but also deleting ./build i can't see the deploying of my migrations files but only

Compiling your contracts...
===========================
> Compiling ./contracts/A.sol
> Compiling ./contracts/B.sol
> Artifacts written to /Users/........./build/contracts
> Compiled successfully using:
   - solc: 0.5.0+commit.1d4f565a.Emscripten.clang

A lot of guides show a code like this:

Running migration: 1_initial_migration.js
Deploying Migrations…
… 0xd01dd7...
Migrations: 0xf741...
Saving successful migration to network…
… 0x78ed...
Saving artifacts…
Running migration: 2_deploy_contracts.js
Deploying HelloWorld…
… 0x0aa9...
HelloWorld: [SAVE THIS ADDRESS!!]
Saving successful migration to network…
… 0xee95...
Saving artifacts…

And here my truffle.js code:

var HDWalletProvider = require("truffle-hdwallet-provider");
const MNEMONIC = 'my mnemonic words from metamask'

module.exports = {
  // See <http://truffleframework.com/docs/advanced/configuration>
  // for more about customizing your Truffle configuration!
  networks: {
    development: {
      host: "127.0.0.1",
      port: 7545,
      network_id: "*" // Match any network id
    },

    ropsten: {
      provider: function() {
        return new HDWalletProvider(MNEMONIC, "ropsten.infura.io/v3/my-key")
      },
      network_id: 3,
      gas: 4000000      //make sure this gas allocation isn't over 4M, which is the max
    }
  }
};

So how can i solve this problem?

4
  • Hi there. Can you include the contents of your truffle-config.js file in your question? Commented Mar 25, 2019 at 17:13
  • @RichardHorrocks done, i updated the request with my truffle.js file Commented Mar 25, 2019 at 17:23
  • Same problem here, did you find the solution?
    – Kise
    Commented Apr 24, 2019 at 6:57
  • Can u also show us the your migration file?
    – haxerl
    Commented May 19, 2019 at 1:48

4 Answers 4

0

In truffle.js (or truffle-config.js) under the ropsten provider, try passing the Infura API URL with https://. So it should look like this:

// Inside truffle.js
  ...

module.exports = {
  networks: {

      ...

    ropsten: {
      provider: function() {
        return new HDWalletProvider(MNEMONIC, "https://ropsten.infura.io/v3/my-key")
      },
      network_id: 3,
      gas: 4000000      //make sure this gas allocation isn't over 4M, which is the max
    }
  }
};
0

I had the same issue, in my case the problem was that I was using a wrong API key. In you Infura dashboard check if you are using the correct one, the one for the Ropsten network.

And as jfviray said pass the Infura API url with https.

0

It might be the case, that someone has manually configured truffle migrations directory in truffle.config.js file and now truffle is not able to detect the migrations directory properly:

module.exports = {
  ...
  migrations_directory: "truffle-migraitons/",
  ...
}
  
0

I solved this by degrading node version to LTS version

just uninstall your node and install the LTS version

truffle migrate --network ropsten

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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