-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtruffle.js
41 lines (36 loc) · 873 Bytes
/
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
36
37
38
39
40
41
require('dotenv').config();
require('babel-register');
require('babel-polyfill');
const WalletProvider = require("truffle-wallet-provider");
const Wallet = require('ethereumjs-wallet');
const Web3 = require("web3");
const w3 = new Web3();
const PRIVKEY = process.env["PRIVKEY"];
const INFURAKEY = process.env["INFURAKEY"];
module.exports = {
solc: {
optimizer: {
enabled: true,
runs: 200
}
},
networks: {
development: {
host: "127.0.0.1",
port: 7545,
network_id: "*",
gas: 4600000,
},
rinkeby: {
provider: function() {
return new WalletProvider(
Wallet.fromPrivateKey(
Buffer.from(PRIVKEY, "hex")), "https://rinkeby.infura.io/"+INFURAKEY
);
},
gas: 4600000,
gasPrice: w3.utils.toWei("50", "gwei"),
network_id: "3",
},
}
};