From a72af75eb34e3dec654d41f8d60f8fcf9716ec28 Mon Sep 17 00:00:00 2001 From: Hoang Trinh Date: Fri, 22 Feb 2019 17:58:01 +0700 Subject: [PATCH] Update Configuration Code --- config/index.js | 26 +++++++++++++++++++++----- truffle.js | 24 ++++++++++++------------ 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/config/index.js b/config/index.js index f54aab3..ec9c246 100644 --- a/config/index.js +++ b/config/index.js @@ -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: [ diff --git a/truffle.js b/truffle.js index 8a6fdc6..1898938 100755 --- a/truffle.js +++ b/truffle.js @@ -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, }, }, }