add lamassu-mnemonic
This commit is contained in:
parent
4f1de93715
commit
0fc5fbbf35
3 changed files with 35 additions and 2 deletions
12
bin/lamassu-mnemonic
Executable file
12
bin/lamassu-mnemonic
Executable file
|
|
@ -0,0 +1,12 @@
|
||||||
|
const fs = require('fs')
|
||||||
|
const bip39 = require('bip39')
|
||||||
|
|
||||||
|
const options = require('../lib/options')
|
||||||
|
|
||||||
|
const seed = fs.readFileSync(options.seedPath, 'utf8').trim()
|
||||||
|
|
||||||
|
const words = bip39.entropyToMnemonic(seed).split(' ')
|
||||||
|
|
||||||
|
for (let i = 0; i < words.length; i += 6) {
|
||||||
|
console.log(words.slice(i, i + 6).join(' '))
|
||||||
|
}
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
"author": "Lamassu (https://lamassu.is)",
|
"author": "Lamassu (https://lamassu.is)",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bignumber.js": "^3.0.0",
|
"bignumber.js": "^3.0.0",
|
||||||
|
"bip39": "^2.3.0",
|
||||||
"body-parser": "^1.15.1",
|
"body-parser": "^1.15.1",
|
||||||
"cookie-parser": "^1.4.3",
|
"cookie-parser": "^1.4.3",
|
||||||
"express": "^4.13.4",
|
"express": "^4.13.4",
|
||||||
|
|
@ -57,7 +58,8 @@
|
||||||
"lamassu-apply-defaults": "./bin/lamassu-apply-defaults",
|
"lamassu-apply-defaults": "./bin/lamassu-apply-defaults",
|
||||||
"hkdf": "./bin/hkdf",
|
"hkdf": "./bin/hkdf",
|
||||||
"lamassu-backup-pg": "./bin/lamassu-backup-pg",
|
"lamassu-backup-pg": "./bin/lamassu-backup-pg",
|
||||||
"lamassu-install-bitcoind": "./bin/lamassu-install-bitcoind"
|
"lamassu-install-bitcoind": "./bin/lamassu-install-bitcoind",
|
||||||
|
"lamassu-mnemonic": "./bin/lamassu-mnemonic"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "ava"
|
"test": "ava"
|
||||||
|
|
|
||||||
21
yarn.lock
21
yarn.lock
|
|
@ -963,6 +963,15 @@ bindings@1.2.1, bindings@^1.2.1:
|
||||||
version "1.2.1"
|
version "1.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.2.1.tgz#14ad6113812d2d37d72e67b4cacb4bb726505f11"
|
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.2.1.tgz#14ad6113812d2d37d72e67b4cacb4bb726505f11"
|
||||||
|
|
||||||
|
bip39@^2.3.0:
|
||||||
|
version "2.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/bip39/-/bip39-2.3.0.tgz#e4ee6c6d1bd90ca00ffd57ad446bdf8c017ff484"
|
||||||
|
dependencies:
|
||||||
|
create-hash "^1.1.0"
|
||||||
|
pbkdf2 "^3.0.9"
|
||||||
|
randombytes "^2.0.1"
|
||||||
|
unorm "^1.3.3"
|
||||||
|
|
||||||
bip66@^1.1.0:
|
bip66@^1.1.0:
|
||||||
version "1.1.4"
|
version "1.1.4"
|
||||||
resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.4.tgz#8a59f8ae16eccb94681c3c2a7b224774605aadfb"
|
resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.4.tgz#8a59f8ae16eccb94681c3c2a7b224774605aadfb"
|
||||||
|
|
@ -1479,7 +1488,7 @@ create-hash@^1.1.0, create-hash@^1.1.1, create-hash@^1.1.2:
|
||||||
ripemd160 "^1.0.0"
|
ripemd160 "^1.0.0"
|
||||||
sha.js "^2.3.6"
|
sha.js "^2.3.6"
|
||||||
|
|
||||||
create-hmac@^1.1.3, create-hmac@^1.1.4:
|
create-hmac@^1.1.2, create-hmac@^1.1.3, create-hmac@^1.1.4:
|
||||||
version "1.1.4"
|
version "1.1.4"
|
||||||
resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.4.tgz#d3fb4ba253eb8b3f56e39ea2fbcb8af747bd3170"
|
resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.4.tgz#d3fb4ba253eb8b3f56e39ea2fbcb8af747bd3170"
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
@ -3413,6 +3422,12 @@ path-type@^1.0.0:
|
||||||
pify "^2.0.0"
|
pify "^2.0.0"
|
||||||
pinkie-promise "^2.0.0"
|
pinkie-promise "^2.0.0"
|
||||||
|
|
||||||
|
pbkdf2@^3.0.9:
|
||||||
|
version "3.0.9"
|
||||||
|
resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.9.tgz#f2c4b25a600058b3c3773c086c37dbbee1ffe693"
|
||||||
|
dependencies:
|
||||||
|
create-hmac "^1.1.2"
|
||||||
|
|
||||||
pg-connection-string@0.1.3:
|
pg-connection-string@0.1.3:
|
||||||
version "0.1.3"
|
version "0.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-0.1.3.tgz#da1847b20940e42ee1492beaf65d49d91b245df7"
|
resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-0.1.3.tgz#da1847b20940e42ee1492beaf65d49d91b245df7"
|
||||||
|
|
@ -4597,6 +4612,10 @@ unique-temp-dir@^1.0.0:
|
||||||
os-tmpdir "^1.0.1"
|
os-tmpdir "^1.0.1"
|
||||||
uid2 "0.0.3"
|
uid2 "0.0.3"
|
||||||
|
|
||||||
|
unorm@^1.3.3:
|
||||||
|
version "1.4.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.4.1.tgz#364200d5f13646ca8bcd44490271335614792300"
|
||||||
|
|
||||||
unpipe@1.0.0, unpipe@~1.0.0:
|
unpipe@1.0.0, unpipe@~1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
|
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue