-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,124 additions
and
394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Arguments } from 'yargs'; | ||
import { GetMnemonicRequest, GetMnemonicResponse } from '../../proto/xudrpc_pb'; | ||
import { callback, loadXudClient } from '../command'; | ||
import { showSeed } from '../utils'; | ||
|
||
const formatOutput = (response: GetMnemonicResponse.AsObject) => { | ||
const { seedMnemonicList } = response; | ||
|
||
showSeed(seedMnemonicList); | ||
|
||
// The mnemonic won't be the same as was returned for the `xucli create` call. | ||
// xud uses aezeed which is salted with random bytes, xud does not store the | ||
// salt or the mnemonic words. Each time xud regenerates the mnemonic, it | ||
// uses a new salt so that the mnemonic is different. | ||
console.log(` | ||
Note that this mnemonic changes each time it is regenerated by xud, but it \ | ||
still restores the same xud node key and underlying wallets. | ||
`); | ||
}; | ||
|
||
export const command = 'getmnemonic'; | ||
|
||
export const describe = 'show the master xud seed mnemonic'; | ||
|
||
export const handler = async (argv: Arguments) => { | ||
(await loadXudClient(argv)).getMnemonic(new GetMnemonicRequest(), callback(argv, formatOutput)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.