Skip to content

Instantly share code, notes, and snippets.

@noot
Created July 18, 2018 16:28
Show Gist options
  • Save noot/fb761eb3fbe7898742b00fc308ce42b6 to your computer and use it in GitHub Desktop.
Save noot/fb761eb3fbe7898742b00fc308ce42b6 to your computer and use it in GitHub Desktop.
var secrets = require("./secrets.json");
var HDWalletProvider = require("truffle-hdwallet-provider");
var Web3 = require('web3');
var web3 = new Web3(Web3.givenProvider || "ws://localhost:8545");
module.exports = {
  // See <http://truffleframework.com/docs/advanced/configuration>
  // to customize your Truffle configuration!
  networks: {
   development: {
      host: "127.0.0.1",
      port: 8545,
      network_id: "*", // Match any network id
      gas: 3000000,
      gasLimit: 46000000
   },
   ropsten: {
      provider: new HDWalletProvider(secrets.mnemonic, "https://ropsten.infura.io/"),
      network_id: "*",
      gas: 1000000,
      gasLimit: 67000000,
      gasPrice: web3.utils.toWei("20", "gwei")
   },
   mainnet: {
      provider: new HDWalletProvider(secrets.mnemonic, "https://mainnet.infura.io/"),
      network_id: 1,
      gas: 1000000,
      gasLimit: 67000000
   } 
  }
};
@noot
Copy link
Author

noot commented Jul 18, 2018

truffle migrate --network ropsten

@noot
Copy link
Author

noot commented Jul 18, 2018

npm install truffle-hdwallet-provider

@noot
Copy link
Author

noot commented Jul 18, 2018

secrets.json:

{
    "mnemonic": "your twelve words here"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment