Skip to content

Instantly share code, notes, and snippets.

@alexytiger
Last active December 2, 2019 01:28
Show Gist options
  • Save alexytiger/9334aea51fd71a33f1e2a4ba31ba2ffa to your computer and use it in GitHub Desktop.
Save alexytiger/9334aea51fd71a33f1e2a4ba31ba2ffa to your computer and use it in GitHub Desktop.
e-book
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