Last active
December 2, 2019 01:28
-
-
Save alexytiger/9334aea51fd71a33f1e2a4ba31ba2ffa to your computer and use it in GitHub Desktop.
e-book
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
networks: { | |
ropsten: { | |
provider: () => { | |
try { | |
const fileContents = readFileSync(path.join(__dirname, 'secret.json'), 'utf8') | |
const data = JSON.parse(fileContents); | |
const privateKey = data.mnemonic; | |
const infuraProjectId = data.infuraProjectToken; | |
const rpcUrl = `https://ropsten.infura.io/v3/${infuraProjectId}`; | |
const ropstenAccountId = 0; | |
return new HDWalletProvider(privateKey, rpcUrl, ropstenAccountId); | |
} catch (err) { | |
console.error(err) | |
} | |
}, | |
network_id: 3, // Ropsten's id | |
gas: 4700000, | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment