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

feat(iota): KeyToolCommand::UpdateAlias accepts a key identity instead of an alias #5040

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

thibault-martinez
Copy link
Member

@thibault-martinez thibault-martinez commented Jan 27, 2025

So that it can update the alias by its alias or address.

Fixes #4889

Before

thibault@Mac ~/i/iota (develop)> ./target/debug/iota client new-address
Keys saved as Bech32.
╭──────────────────────────────────────────────────────────────────────────────────────────────╮
│ Created new keypair and saved it to keystore.                                                │
├────────────────┬─────────────────────────────────────────────────────────────────────────────┤
│ alias          │ intelligent-moonstone                                                       │
│ address        │ 0x015a926a39f445392acf1843660648145148425e05f4cbc28d1275dda4b45b0f          │
│ keyScheme      │ ed25519                                                                     │
│ recoveryPhrase │ logic venue ridge throw addict gift tomorrow object ozone minor reform same │
╰────────────────┴─────────────────────────────────────────────────────────────────────────────╯

thibault@Mac ~/i/iota (develop)> ./target/debug/iota keytool update-alias intelligent-moonstone tibo
Old alias intelligent-moonstone was updated to tibo

thibault@Mac ~/i/iota (develop)> ./target/debug/iota keytool list
╭────────────────────────────────────────────────────────────────────────────────────────────╮
│ ╭─────────────────┬──────────────────────────────────────────────────────────────────────╮ │
│ │ alias           │  tibo                                                                │ │
│ │ iotaAddress     │  0x015a926a39f445392acf1843660648145148425e05f4cbc28d1275dda4b45b0f  │ │
│ │ publicBase64Key │  ahdwqh+MIa9nbSf+ikHyieCa2GjQzBzQXDG/DuBwVOw=                        │ │
│ │ keyScheme       │  ed25519                                                             │ │
│ │ flag            │  0                                                                   │ │
│ │ peerId          │  6a1770aa1f8c21af676d27fe8a41f289e09ad868d0cc1cd05c31bf0ee07054ec    │ │
│ ╰─────────────────┴──────────────────────────────────────────────────────────────────────╯ │
╰────────────────────────────────────────────────────────────────────────────────────────────╯

thibault@Mac ~/i/iota (develop)> ./target/debug/iota keytool update-alias 0x015a926a39f445392acf1843660648145148425e05f4cbc28d1275dda4b45b0f intelligent-moonstone
The provided alias 0x015a926a39f445392acf1843660648145148425e05f4cbc28d1275dda4b45b0f does not exist

After

thibault@Mac ~/i/iota (flexible-update-alias)> ./target/debug/iota client new-address
Keys saved as Bech32.
╭───────────────────────────────────────────────────────────────────────────────────────────╮
│ Created new keypair and saved it to keystore.                                             │
├────────────────┬──────────────────────────────────────────────────────────────────────────┤
│ alias          │ vibrant-coral                                                            │
│ address        │ 0xe0f262552d792372137092c7c2d1acf952456400f784160a318c4242e4c3801f       │
│ keyScheme      │ ed25519                                                                  │
│ recoveryPhrase │ city august oppose change neither actor real act blanket casino cat hunt │
╰────────────────┴──────────────────────────────────────────────────────────────────────────╯

thibault@Mac ~/i/iota (flexible-update-alias)> ./target/debug/iota keytool update-alias vibrant-coral tibo
Old alias vibrant-coral was updated to tibo

thibault@Mac ~/i/iota (flexible-update-alias)> ./target/debug/iota keytool list
╭────────────────────────────────────────────────────────────────────────────────────────────╮
│ ╭─────────────────┬──────────────────────────────────────────────────────────────────────╮ │
│ │ alias           │  tibo                                                                │ │
│ │ iotaAddress     │  0xe0f262552d792372137092c7c2d1acf952456400f784160a318c4242e4c3801f  │ │
│ │ publicBase64Key │  lIvz0m1oiETfKXkh6NYlQlaqtTZeidt6ZuJs2UaZQhA=                        │ │
│ │ keyScheme       │  ed25519                                                             │ │
│ │ flag            │  0                                                                   │ │
│ │ peerId          │  948bf3d26d688844df297921e8d6254256aab5365e89db7a66e26cd946994210    │ │
│ ╰─────────────────┴──────────────────────────────────────────────────────────────────────╯ │
╰────────────────────────────────────────────────────────────────────────────────────────────╯

thibault@Mac ~/i/iota (flexible-update-alias)> ./target/debug/iota keytool update-alias 0xe0f262552d792372137092c7c2d1acf952456400f784160a318c4242e4c3801f vibrant-coral
Old alias tibo was updated to vibrant-coral

thibault@Mac ~/i/iota (flexible-update-alias)> ./target/debug/iota keytool list
╭────────────────────────────────────────────────────────────────────────────────────────────╮
│ ╭─────────────────┬──────────────────────────────────────────────────────────────────────╮ │
│ │ alias           │  vibrant-coral                                                       │ │
│ │ iotaAddress     │  0xe0f262552d792372137092c7c2d1acf952456400f784160a318c4242e4c3801f  │ │
│ │ publicBase64Key │  lIvz0m1oiETfKXkh6NYlQlaqtTZeidt6ZuJs2UaZQhA=                        │ │
│ │ keyScheme       │  ed25519                                                             │ │
│ │ flag            │  0                                                                   │ │
│ │ peerId          │  948bf3d26d688844df297921e8d6254256aab5365e89db7a66e26cd946994210    │ │
│ ╰─────────────────┴──────────────────────────────────────────────────────────────────────╯ │
╰────────────────────────────────────────────────────────────────────────────────────────────╯

Copy link

vercel bot commented Jan 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
apps-backend ⬜️ Ignored (Inspect) Jan 27, 2025 3:26pm
apps-ui-kit ⬜️ Ignored (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 3:26pm
rebased-explorer ⬜️ Ignored (Inspect) Visit Preview Jan 27, 2025 3:26pm
wallet-dashboard ⬜️ Ignored (Inspect) Jan 27, 2025 3:26pm

@iota-ci iota-ci added dev-tools Issues related to the Developer Tools Team sc-platform Issues related to the Smart Contract Platform group. labels Jan 27, 2025
@thibault-martinez thibault-martinez marked this pull request as ready for review January 27, 2025 15:57
@thibault-martinez thibault-martinez requested a review from a team as a code owner January 27, 2025 15:57
Copy link
Contributor

@DaughterOfMars DaughterOfMars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine but I guess I just wonder why we're doing this? Doesn't seem that useful to me but 🤷‍♀️

@thibault-martinez thibault-martinez merged commit 1e86095 into develop Jan 28, 2025
66 checks passed
@thibault-martinez thibault-martinez deleted the flexible-update-alias branch January 28, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-tools Issues related to the Developer Tools Team sc-platform Issues related to the Smart Contract Platform group.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI/Keytool: Make UpdateAlias command more flexible
4 participants