-
Notifications
You must be signed in to change notification settings - Fork 5
/
truffle.js
55 lines (48 loc) · 1.36 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const LedgerWalletProvider = require('truffle-ledger-provider');
const NonceTrackerSubprovider = require("web3-provider-engine/subproviders/nonce-tracker")
// var infuraApiKey = process.env.INFURA_APIKEY;
const kovanLedgerOptions = {
networkId: 42,
accountsOffset: 0,
};
const mainnetLedgerOptions = {
networkId: 1,
accountsOffset: 0,
};
module.exports = {
networks: {
development: {
host: '127.0.0.1',
port: 8545,
network_id: '*',
},
mainnet: {
provider() {
const wallet = new LedgerWalletProvider(
mainnetLedgerOptions,
'https://mainnet.infura.io/v3/94b6488e61684d60800d7d8aa6263431',
);
const nonceTracker = new NonceTrackerSubprovider();
wallet.engine._providers.unshift(nonceTracker);
nonceTracker.setEngine(wallet.engine)
return wallet;
},
network_id: mainnetLedgerOptions.networkId,
gas: 800000,
gasPrice: 7000000000,
},
kovan: {
provider() {
return new LedgerWalletProvider(
kovanLedgerOptions,
'https://kovan.infura.io/v3/94b6488e61684d60800d7d8aa6263431',
);
},
network_id: kovanLedgerOptions.networkId,
gas: 4600000,
gasPrice: 25000000000,
},
},
};
// "https://kovan.infura.io/" + infuraApiKey
// https://kovan.infura.io/v3/94b6488e61684d60800d7d8aa6263431