feat: decouple l-s entrypoint
This commit is contained in:
parent
2a2c1fccc8
commit
f4d6b5e454
48 changed files with 411 additions and 232 deletions
|
|
@ -7,7 +7,6 @@ const pify = require('pify')
|
|||
const fs = pify(require('fs'))
|
||||
|
||||
const mnemonicHelpers = require('./mnemonic-helpers')
|
||||
const options = require('./options')
|
||||
const ph = require('./plugin-helper')
|
||||
const layer2 = require('./layer2')
|
||||
const httpError = require('./route-helpers').httpError
|
||||
|
|
@ -20,6 +19,8 @@ const INSUFFICIENT_FUNDS_CODE = 570
|
|||
const INSUFFICIENT_FUNDS_NAME = 'InsufficientFunds'
|
||||
const ZERO_CONF_EXPIRATION = 60000
|
||||
|
||||
const MNEMONIC_PATH = process.env.MNEMONIC_PATH
|
||||
|
||||
function computeSeed (masterSeed) {
|
||||
return hkdf(masterSeed, 32, { salt: 'lamassu-server-salt', info: 'wallet-seed' })
|
||||
}
|
||||
|
|
@ -29,7 +30,7 @@ function computeOperatorId (masterSeed) {
|
|||
}
|
||||
|
||||
function fetchWallet (settings, cryptoCode) {
|
||||
return fs.readFile(options.mnemonicPath, 'utf8')
|
||||
return fs.readFile(MNEMONIC_PATH, 'utf8')
|
||||
.then(mnemonic => {
|
||||
const masterSeed = mnemonicHelpers.toEntropyBuffer(mnemonic)
|
||||
const plugin = configManager.getWalletSettings(cryptoCode, settings.config).wallet
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue