Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/*
* NB: since truffle-hdwallet-provider 0.0.5 you must wrap HDWallet providers in a
* function when declaring them. Failure to do so will cause commands to hang. ex:
* ```
* mainnet: {
* provider: function() {
* return new HDWalletProvider(mnemonic, 'https://mainnet.infura.io/<infura-key>')
* },
* network_id: '1',
* gas: 4500000,
* gasPrice: 10000000000,
* },
*/
var HDWalletProvider = require("truffle-hdwallet-provider");
const mnemonic = process.env.MNEMONIC
const infura_apikey = process.env.INFURA_APIKEY
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*", // Match any network id
gas: 4600000
},
ropsten: {
provider: function() {
return new HDWalletProvider(mnemonic, 'https://ropsten.infura.io/' + infura_apikey)
},
network_id: 3,
gas: 2900000,
gasPrice: 50000000000
},
sokol: {
provider: function() {
return new HDWalletProvider(mnemonic, 'https://sokol.poa.network/')
},
network_id: "77"
},
core: {
provider: function() {
return new HDWalletProvider(mnemonic, 'https://core.poa.network/')
},
network_id: "99"
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment