Skip to content

Commit

Permalink
Update Configuration Code
Browse files Browse the repository at this point in the history
  • Loading branch information
piavgh committed Feb 22, 2019
1 parent 4f5ec33 commit a72af75
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 17 deletions.
26 changes: 21 additions & 5 deletions config/index.js
Expand Up @@ -89,11 +89,27 @@ module.exports = {
tomochainTestnet: 'https://testnet.tomochain.com',
},
constants: {
DEFAULT_GAS: 4.5 * 10 ** 6,
MAX_GAS: 20 * 10 ** 6,
DEFAULT_LOW_GAS_PRICE: 0.1 * 10 ** 9,
DEFAULT_GAS_PRICE: 10 ** 14,
DEFAULT_HIGH_GAS_PRICE: 9 * 10 ** 9,
development: {
DEFAULT_GAS: 4.5 * 10 ** 6,
MAX_GAS: 6.0 * 10 ** 6,
DEFAULT_LOW_GAS_PRICE: 0.1 * 10 ** 9,
DEFAULT_GAS_PRICE: 15 * 10 ** 9,
DEFAULT_HIGH_GAS_PRICE: 9 * 10 ** 9,
},
tomochain: {
DEFAULT_GAS: 4.5 * 10 ** 6,
MAX_GAS: 20 * 10 ** 6,
DEFAULT_LOW_GAS_PRICE: 0.1 * 10 ** 9,
DEFAULT_GAS_PRICE: 10 ** 14,
DEFAULT_HIGH_GAS_PRICE: 9 * 10 ** 9,
},
tomochainTestnet: {
DEFAULT_GAS: 4.5 * 10 ** 6,
MAX_GAS: 20 * 10 ** 6,
DEFAULT_LOW_GAS_PRICE: 0.1 * 10 ** 9,
DEFAULT_GAS_PRICE: 10 ** 14,
DEFAULT_HIGH_GAS_PRICE: 9 * 10 ** 9,
},
},
accounts: {
marketMaker: [
Expand Down
24 changes: 12 additions & 12 deletions truffle.js
Expand Up @@ -17,39 +17,39 @@ module.exports = {
host: 'localhost',
port: 8545,
network_id: config.NETWORK_ID.DEVELOPMENT,
gas: config.constants.MAX_GAS,
gasPrice: config.constants.DEFAULT_GAS_PRICE,
gas: config.constants.development.MAX_GAS,
gasPrice: config.constants.development.DEFAULT_GAS_PRICE,
from: '0xF9D87abd60435b70415CcC1FAAcA4F8B91786eDb', // testprc main account here
},
ethereum: {
provider: () => new HDWalletProvider(secret.ethereum.mnemonic, config.rpcEndpoints.ethereum),
network_id: config.NETWORK_ID.ETHEREUM,
gas: config.constants.MAX_GAS,
gasPrice: config.constants.DEFAULT_GAS_PRICE,
gas: config.constants.development.MAX_GAS,
gasPrice: config.constants.development.DEFAULT_GAS_PRICE,
},
ropsten: {
provider: () => new HDWalletProvider(secret.ropsten.mnemonic, config.rpcEndpoints.ropsten),
network_id: config.NETWORK_ID.ROPSTEN,
gas: config.constants.MAX_GAS,
gasPrice: config.constants.DEFAULT_GAS_PRICE,
gas: config.constants.development.MAX_GAS,
gasPrice: config.constants.development.DEFAULT_GAS_PRICE,
},
rinkeby: {
provider: () => new HDWalletProvider(secret.rinkeby.mnemonic, config.rpcEndpoints.rinkeby),
network_id: config.NETWORK_ID.RINKEBY,
gas: config.constants.MAX_GAS,
gasPrice: config.constants.DEFAULT_GAS_PRICE,
gas: config.constants.development.MAX_GAS,
gasPrice: config.constants.development.DEFAULT_GAS_PRICE,
},
tomochain: {
provider: () => new HDWalletProvider(secret.tomochain.mnemonic, config.rpcEndpoints.tomochain),
network_id: config.NETWORK_ID.TOMOCHAIN,
gas: config.constants.MAX_GAS,
gasPrice: config.constants.DEFAULT_GAS_PRICE,
gas: config.constants.tomochain.MAX_GAS,
gasPrice: config.constants.tomochain.DEFAULT_GAS_PRICE,
},
tomochainTestnet: {
provider: () => new HDWalletProvider(secret.tomochainTestnet.mnemonic, config.rpcEndpoints.tomochainTestnet),
network_id: config.NETWORK_ID.TOMOCHAIN_TESTNET,
gas: config.constants.MAX_GAS,
gasPrice: config.constants.DEFAULT_GAS_PRICE,
gas: config.constants.tomochainTestnet.MAX_GAS,
gasPrice: config.constants.tomochainTestnet.DEFAULT_GAS_PRICE,
},
},
}

0 comments on commit a72af75

Please sign in to comment.