2

I am stuck with an issue as unable to deploying Truffle Contracts to Rinkeby network! As shown here it's using network 'development'? why? I want Rinkeby!

ASMAHANs-MacBook-Pro:project-6 asmahan$ truffle compile
ASMAHANs-MacBook-Pro:project-6 asmahan$ truffle migrate network rinkeby
Using network 'development'.

Network up to date.

I made sure I installed both of the web3, truffle, infura and MetaMask. here is truffle.js file

const HDWalletProvider = require("truffle-hdwallet-provider");
module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",
      port: 8545,
      network_id: "*" // Match any network id
    },
    rinkeby: {
      provider: function () {
        return new HDWalletProvider("mus***********tuff sustain",
          "rinkeby.infura.io/v3/********")
      },
      network_id: '4',
      gas: 4500000,
      gasPrice: 10000000000,
    }
  }
};

1 Answers1

1

the network option for truffle is not written the right way. According to https://truffleframework.com/docs/truffle/reference/truffle-commands#compile the right syntax is :

--network : Specify the network to use, saving artifacts specific to that network. Network name must exist in the configuration.

So your command line should be : truffle migrate --network rinkeby

Nicolas Massart
  • 6,783
  • 2
  • 29
  • 63