Skip to main content
Proper code format snippet instead of grey and add bold tag
Source Link

The sample code here for deploying to RopstenRopsten used HDWalletProviderHDWalletProvider and a mnemonicmnemonic in the configconfiguration, but I am not sure I understand its purpose. Is this just telling it the account that will become the contract owner when you deploy?

var HDWalletProvider = require("truffle-hdwallet-provider");

// 12-word mnemonic
var mnemonic = process.env.NMEMONIC;

module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",
      port: 8545,
      network_id: "*" // Match any network id
    },
    ropsten: {
      provider: new HDWalletProvider(mnemonic, "https://ropsten.infura.io/"),
      network_id: 3 // official id of the ropsten network
    }
  }
};

Is this just telling it the account that will become the contract owner when you deploy?

var HDWalletProvider = require("truffle-hdwallet-provider");

// 12-word mnemonic
var mnemonic = process.env.NMEMONIC;

module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",
      port: 8545,
      network_id: "*" // Match any network id
    },
    ropsten: {
      provider: new HDWalletProvider(mnemonic, "https://ropsten.infura.io/"),
      network_id: 3 // official id of the ropsten network
    }
  }
};

The sample code here for deploying to Ropsten used HDWalletProvider and a mnemonic in the config, but I am not sure I understand its purpose. Is this just telling it the account that will become the contract owner when you deploy?

var HDWalletProvider = require("truffle-hdwallet-provider");

// 12-word mnemonic
var mnemonic = process.env.NMEMONIC;

module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",
      port: 8545,
      network_id: "*" // Match any network id
    },
    ropsten: {
      provider: new HDWalletProvider(mnemonic, "https://ropsten.infura.io/"),
      network_id: 3 // official id of the ropsten network
    }
  }
};

The sample code here for deploying to Ropsten used HDWalletProvider and a mnemonic in the configuration, but I am not sure I understand its purpose.

Is this just telling it the account that will become the contract owner when you deploy?

var HDWalletProvider = require("truffle-hdwallet-provider");

// 12-word mnemonic
var mnemonic = process.env.NMEMONIC;

module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",
      port: 8545,
      network_id: "*" // Match any network id
    },
    ropsten: {
      provider: new HDWalletProvider(mnemonic, "https://ropsten.infura.io/"),
      network_id: 3 // official id of the ropsten network
    }
  }
};
Source Link

What is use of HDWalletProvider in Truffle config?

The sample code here for deploying to Ropsten used HDWalletProvider and a mnemonic in the config, but I am not sure I understand its purpose. Is this just telling it the account that will become the contract owner when you deploy?

var HDWalletProvider = require("truffle-hdwallet-provider");

// 12-word mnemonic
var mnemonic = process.env.NMEMONIC;

module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",
      port: 8545,
      network_id: "*" // Match any network id
    },
    ropsten: {
      provider: new HDWalletProvider(mnemonic, "https://ropsten.infura.io/"),
      network_id: 3 // official id of the ropsten network
    }
  }
};