fix blockchain configDir
This commit is contained in:
parent
ad66fe1b43
commit
d0fc03c385
5 changed files with 8 additions and 5 deletions
|
|
@ -52,7 +52,7 @@ const CRYPTO_CURRENCIES = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
module.exports = {buildUrl, cryptoDir, cryptoCurrencies, getCryptoCurrency}
|
module.exports = {buildUrl, cryptoDir, configPath, cryptoCurrencies, getCryptoCurrency}
|
||||||
|
|
||||||
function getCryptoCurrency (cryptoCode) {
|
function getCryptoCurrency (cryptoCode) {
|
||||||
const cryptoCurrency = _.find(['cryptoCode', cryptoCode], CRYPTO_CURRENCIES)
|
const cryptoCurrency = _.find(['cryptoCode', cryptoCode], CRYPTO_CURRENCIES)
|
||||||
|
|
@ -81,3 +81,6 @@ function cryptoDir (cryptoRec) {
|
||||||
return path.resolve(blockchainDir, code)
|
return path.resolve(blockchainDir, code)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function configPath (cryptoRec) {
|
||||||
|
return path.resolve(cryptoDir(cryptoRec), cryptoRec.configFile)
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ const E = require('../../../error')
|
||||||
const coinUtils = require('../../../coin-utils')
|
const coinUtils = require('../../../coin-utils')
|
||||||
|
|
||||||
const cryptoRec = coinUtils.getCryptoCurrency('BTC')
|
const cryptoRec = coinUtils.getCryptoCurrency('BTC')
|
||||||
const configPath = coinUtils.cryptoDir(cryptoRec)
|
const configPath = coinUtils.configPath(cryptoRec)
|
||||||
const unitScale = cryptoRec.unitScale
|
const unitScale = cryptoRec.unitScale
|
||||||
const config = jsonRpc.parseConf(configPath)
|
const config = jsonRpc.parseConf(configPath)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ const BN = require('../../../bn')
|
||||||
const E = require('../../../error')
|
const E = require('../../../error')
|
||||||
|
|
||||||
const cryptoRec = coinUtils.getCryptoCurrency('DASH')
|
const cryptoRec = coinUtils.getCryptoCurrency('DASH')
|
||||||
const configPath = coinUtils.cryptoDir(cryptoRec)
|
const configPath = coinUtils.configPath(cryptoRec)
|
||||||
const unitScale = cryptoRec.unitScale
|
const unitScale = cryptoRec.unitScale
|
||||||
const config = jsonRpc.parseConf(configPath)
|
const config = jsonRpc.parseConf(configPath)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ const BN = require('../../../bn')
|
||||||
const E = require('../../../error')
|
const E = require('../../../error')
|
||||||
|
|
||||||
const cryptoRec = coinUtils.getCryptoCurrency('LTC')
|
const cryptoRec = coinUtils.getCryptoCurrency('LTC')
|
||||||
const configPath = coinUtils.cryptoDir(cryptoRec)
|
const configPath = coinUtils.configPath(cryptoRec)
|
||||||
const unitScale = cryptoRec.unitScale
|
const unitScale = cryptoRec.unitScale
|
||||||
const config = jsonRpc.parseConf(configPath)
|
const config = jsonRpc.parseConf(configPath)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ const BN = require('../../../bn')
|
||||||
const E = require('../../../error')
|
const E = require('../../../error')
|
||||||
|
|
||||||
const cryptoRec = coinUtils.getCryptoCurrency('ZEC')
|
const cryptoRec = coinUtils.getCryptoCurrency('ZEC')
|
||||||
const configPath = coinUtils.cryptoDir(cryptoRec)
|
const configPath = coinUtils.configPath(cryptoRec)
|
||||||
const unitScale = cryptoRec.unitScale
|
const unitScale = cryptoRec.unitScale
|
||||||
const config = jsonRpc.parseConf(configPath)
|
const config = jsonRpc.parseConf(configPath)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue