-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtruffle-config.js
70 lines (63 loc) · 2.47 KB
/
truffle-config.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
* Use this file to configure your truffle project. It's seeded with some
* common settings for different networks and features like migrations,
* compilation and testing. Uncomment the ones you need or modify
* them to suit your project as necessary.
*
* More information about configuration can be found at:
*
* trufflesuite.com/docs/advanced/configuration
*
* To deploy via Infura you'll need a wallet provider (like @truffle/hdwallet-provider)
* to sign your transactions before they're sent to a remote public node. Infura accounts
* are available for free at: infura.io/register.
*
* You'll also need a mnemonic - the twelve word phrase the wallet uses to generate
* public/private key pairs. If you're publishing your code to GitHub make sure you load this
* phrase from a file you've .gitignored so it doesn't accidentally become public.
*
*/
const HDWalletProvider = require("truffle-hdwallet-provider");
// const infuraKey = "fj4jll3k.....";
//
const fs = require('fs');
let secrets;
if (fs.existsSync('secrets.json')) { secrets = JSON.parse(fs.readFileSync('secrets.json', 'utf8')); }
module.exports = {
networks: {
rinkeby: {
// Special function to setup the provider
provider: function () {
// Setting the provider with the Infura Rinkeby address and Token
return new HDWalletProvider(secrets.mnemonic, "https://rinkeby.infura.io/v3/7c42497e624448fcb7deb88e2afc2d04")
},
// Network id is 4 for Rinkeby
network_id: 4
}
/*ropsten: {
provider: () => new HDWalletProvider('total april swamp rebuild shiver sheriff oyster omit dish nominee open belt', 'https://ropsten.infura.io/v3/3bf69fe7dcf84d9ba59ea542e94ee035'),
network_id: 3, // Ropsten's id
gas: 1900000, // Ropsten has a lower block limit than mainnet
confirmations: 2, // # of confs to wait between deployments. (default: 0)
timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
// Skip dry run before migrations? (default: false for public nets )
},*/
/*
ropsten: {
provider: function() {
return new HDWalletProvider('total april swamp rebuild shiver sheriff oyster omit dish nominee open belt', 'https://ropsten.infura.io/v3/3bf69fe7dcf84d9ba59ea542e94ee035');
},
network_id: 3,
host: "localhost",
port: 8545,
gas: 1000000
}*/
},
mocha: {
},
// Configure your compilers
compilers: {
solc: {
},
},
};