Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initializng the node from seed phrase #523

Closed
b00f opened this issue Jun 19, 2023 · 0 comments · Fixed by #533
Closed

Initializng the node from seed phrase #523

b00f opened this issue Jun 19, 2023 · 0 comments · Fixed by #533
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed Pactus-Daemon

Comments

@b00f
Copy link
Collaborator

b00f commented Jun 19, 2023

Describe the problem you'd like to have solved

Currently, users cannot initialize a node from a previously saved seed phrase.
When a user runs pactus-daemon init, it creates a new wallet using a new seed phrase.

Describe the ideal solution

We should add a new string option to the init command, for example: pactus-daemon init --seed "<12-words-seed>.
The bip39.IsMnemonicValid API can be used to confirm the seed phrase is valid.
If the --seed option isn't used, a new seed phrase can be generated.

Alternatives and current work-around

Currently, there is no easy work-around for this problem. The only alternative is for users to manually use pactus-wallet to recover their wallet, and then replace it with the default_wallet.

Related to #522

@b00f b00f added good first issue Good for newcomers help wanted Extra attention is needed Pactus-Daemon labels Jun 19, 2023
@Ja7ad Ja7ad self-assigned this Jun 24, 2023
@b00f b00f closed this as completed in #533 Jun 28, 2023
b00f pushed a commit that referenced this issue Jun 28, 2023
* feat: add validate seed and restore wallet

Fixed #523

* test: add test for IsMnemonicValid

* fix: add replace EntropyFromMnemonic for validate mnemonic

* fix: seed switch change to restore becuase we validate and restore seed

* fix: description restore wallet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed Pactus-Daemon
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants