Skip to content

Instantly share code, notes, and snippets.

@hskang9
Last active January 7, 2019 19:07
Show Gist options
  • Save hskang9/c00354c1c6bfa2cd13d0aed446053a57 to your computer and use it in GitHub Desktop.
Save hskang9/c00354c1c6bfa2cd13d0aed446053a57 to your computer and use it in GitHub Desktop.
Configuration for truffle framework
const HDWalletProvider = require("truffle-hdwallet-provider");
require('dotenv').config() // Store environment-specific variable from '.env' to process.env
module.exports = {
networks: {
development: {
host: 'localhost',
port: 8545,
network_id: '*' // Match any network id
},
// testnets
// properties
// network_id: identifier for network based on ethereum blockchain. Find out more at https://github.com/ethereumbook/ethereumbook/issues/110
// gas: gas limit
// gasPrice: gas price in gwei
ropsten: {
provider: () => new HDWalletProvider(process.env.MNENOMIC, "https://ropsten.infura.io/v3/" + process.env.INFURA_API_KEY),
network_id: 3,
gas: 3000000,
gasPrice: 10000000000
},
kovan: {
provider: () => new HDWalletProvider(process.env.MNENOMIC, "https://kovan.infura.io/v3/" + process.env.INFURA_API_KEY),
network_id: 42,
gas: 3000000,
gasPrice: 10000000000
},
rinkeby: {
provider: () => new HDWalletProvider(process.env.MNENOMIC, "https://rinkeby.infura.io/v3/" + process.env.INFURA_API_KEY),
network_id: 4,
gas: 3000000,
gasPrice: 10000000000
},
// main ethereum network(mainnet)
main: {
provider: () => new HDWalletProvider(process.env.MNENOMIC, "https://mainnet.infura.io/v3/" + process.env.INFURA_API_KEY),
network_id: 1,
gas: 3000000,
gasPrice: 10000000000
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment