Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 34 additions & 12 deletions truffle.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,43 @@
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
}
},
solc: {
// Turns on the Solidity optimizer. For development the optimizer's
// quite helpful, just remember to be careful, and potentially turn it
// off, for live deployment and/or audit time. For more information,
// see the Truffle 4.0.0 release notes.
//
// https://github.com/trufflesuite/truffle/releases/tag/v4.0.0
optimizer: {
enabled: true,
runs: 200
},
// 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/" + process.env.INFURA_API_KEY),
network_id: 3,
gas: 3000000,
gasPrice: 21
},
kovan: {
provider: () => new HDWalletProvider(process.env.MNENOMIC, "https://kovan.infura.io/" + process.env.INFURA_API_KEY),
network_id: 42,
gas: 3000000,
gasPrice: 21
},
rinkeby: {
provider: () => new HDWalletProvider(process.env.MNENOMIC, "https://rinkeby.infura.io/" + process.env.INFURA_API_KEY),
network_id: 4,
gas: 3000000,
gasPrice: 21
},
// main ethereum network(mainnet)
main: {
provider: () => new HDWalletProvider(process.env.MNENOMIC, "https://mainnet.infura.io/" + process.env.INFURA_API_KEY),
network_id: 1,
gas: 3000000,
gasPrice: 21
}
}
}