fix: operator id fetching on scripts
This commit is contained in:
parent
07f4bdfb66
commit
0fd0d21599
3 changed files with 13 additions and 12 deletions
4
bin/hkdf
4
bin/hkdf
|
|
@ -13,5 +13,5 @@ if (process.argv.length !== 4) {
|
||||||
process.exit(3)
|
process.exit(3)
|
||||||
}
|
}
|
||||||
|
|
||||||
const masterSeed = new Buffer(masterSeedHex, 'hex')
|
const masterSeed = Buffer.from(masterSeedHex, 'hex')
|
||||||
console.log(hkdf(masterSeed, 32, {salt: 'lamassu-server-salt', info: label}).toString('hex'))
|
console.log(hkdf(masterSeed, 32, { salt: 'lamassu-server-salt', info: label }).toString('hex'))
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
SEED="$(cat ~/seeds/seed.txt)"
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Here is the 'External ID' of your paired machine(s), for use under the 'ATM / Teller details' of your CoinATMRadar listing:"
|
echo "Here is the 'External ID' of your paired machine(s), for use under the 'ATM / Teller details' of your CoinATMRadar listing:"
|
||||||
echo
|
echo
|
||||||
|
|
@ -9,5 +7,5 @@ su - postgres -c "psql \"lamassu\" -Atc \"select regexp_replace(device_id, '$',
|
||||||
echo
|
echo
|
||||||
echo "If speaking with CoinATMRadar directly, it may be helpful to let them know your 'Operator ID':"
|
echo "If speaking with CoinATMRadar directly, it may be helpful to let them know your 'Operator ID':"
|
||||||
echo
|
echo
|
||||||
$(npm root -g)/lamassu-server/bin/hkdf operator-id "$SEED" | cut -c -32
|
$(npm root -g)/lamassu-server/bin/lamassu-operator
|
||||||
echo
|
echo
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env node
|
||||||
|
|
||||||
SEED="$(cat ~/seeds/seed.txt)"
|
const fs = require('fs')
|
||||||
|
const hkdf = require('futoin-hkdf')
|
||||||
|
|
||||||
echo
|
const options = require('../lib/options')
|
||||||
echo "Your Operator ID for use with CoinATMRadar is:"
|
const mnemonicHelpers = require('../lib/mnemonic-helpers')
|
||||||
echo
|
|
||||||
/usr/bin/hkdf operator-id "$SEED" | cut -c -32
|
const mnemonic = fs.readFileSync(options.mnemonicPath, 'utf8').trim()
|
||||||
echo
|
const masterSeed = mnemonicHelpers.toEntropyBuffer(mnemonic)
|
||||||
|
|
||||||
|
console.log(hkdf(masterSeed, 16, { salt: 'lamassu-server-salt', info: 'operator-id' }).toString('hex'))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue