-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtruffle.js
35 lines (32 loc) · 1.04 KB
/
truffle.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require('dotenv').config();
const Web3 = require("web3");
const web3 = new Web3();
const WalletProvider = require("truffle-wallet-provider");
const Wallet = require('ethereumjs-wallet');
const ropstenPrivateKey = new Buffer(process.env["ROPSTEN_PRIVATE_KEY"], "hex")
const ropstenWallet = Wallet.fromPrivateKey(ropstenPrivateKey);
const ropstenProvider = new WalletProvider(ropstenWallet, "https://ropsten.infura.io/");
const mainNetPrivateKey = new Buffer(process.env["MAINNET_PRIVATE_KEY"], "hex")
const mainNetWallet = Wallet.fromPrivateKey(mainNetPrivateKey);
const mainNetProvider = new WalletProvider(mainNetWallet, "https://mainnet.infura.io/");
module.exports = {
networks: {
development: {
host: "localhost",
port: 7545,
network_id: "*"
},
ropsten: {
provider: ropstenProvider,
gas: 4600000,
gasPrice: 30,
network_id: "3"
},
// mainnet: {
// provider: mainNetProvider,
// gas: 4600000,
// gasPrice: web3.toWei("20", "gwei"),
// network_id: "1",
// }
}
};