forked from fuseio/fuse-network
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtruffle-config.js
68 lines (65 loc) · 1.48 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
require('dotenv').config()
const HDWalletProvider = require('truffle-hdwallet-provider')
const fs = require('fs')
const EthWallet = require('ethereumjs-wallet')
const {
RPC,
WALLET_PROVIDER_METHOD,
CREDENTIALS_KEYSTORE,
CREDENTIALS_PASSWORD,
MNEMONIC
} = process.env
let walletProvider
if (WALLET_PROVIDER_METHOD === 'keystore') {
const keystore = fs.readFileSync(CREDENTIALS_KEYSTORE).toString()
const password = fs.readFileSync(CREDENTIALS_PASSWORD).toString().trim()
const wallet = EthWallet.fromV3(keystore, password)
const pkey = wallet.getPrivateKeyString()
walletProvider = new HDWalletProvider(pkey, RPC)
} else if (WALLET_PROVIDER_METHOD === 'mnemonic') {
walletProvider = new HDWalletProvider(MNEMONIC, RPC)
}
module.exports = {
networks: {
ganache: {
host: 'localhost',
port: 8545,
network_id: '*',
gas: 10000000
},
test: {
host: 'localhost',
port: 8545,
network_id: '*',
gas: 10000000
},
fuse: {
provider: walletProvider,
network_id: 122,
// gas: 10000000,
gasPrice: 1000000000 // 1 gwei
},
local: {
provider: walletProvider,
network_id: 999,
// gas: 10000000,
gasPrice: 1000000000 // 1 gwei
}
},
compilers: {
solc: {
version: '0.4.24',
optimizer: {
enabled: true,
runs: 200
}
}
},
mocha: {
reporter: 'eth-gas-reporter',
reporterOptions: {
currency: 'USD',
gasPrice: 1
}
}
}