-
Notifications
You must be signed in to change notification settings - Fork 131
Create stellar-keys.mdx #2233
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
Merged
Merged
Create stellar-keys.mdx #2233
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
45e6768
Create stellar-keys.mdx
janewang f4c6f56
Update stellar-keys.mdx
janewang 185e0ba
Update stellar-keys.mdx
janewang c0ccb73
Merge branch 'main' into janewang-patch-cookbook
janewang bc36062
Merge branch 'main' into janewang-patch-cookbook
janewang d97111b
Merge branch 'main' into janewang-patch-cookbook
janewang 2259d1a
Run make fmt
janewang f4cb3b0
Replace test identity with carol identity
janewang aba531d
Add suggested changes
janewang 840ecbb
Update cookbook/stellar-keys.mdx
janewang f8d39dd
Merge branch 'main' into janewang-patch-cookbook
janewang 412dbfb
Add suggested changes
janewang c4492cf
Merge branch 'main' into janewang-patch-cookbook
janewang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,124 @@ | ||
| --- | ||
| title: Stellar Keys | ||
| hide_table_of_contents: true | ||
| description: Manage stellar keys | ||
| custom_edit_url: https://github.com/stellar/stellar-cli/edit/main/cookbook/stellar-keys.mdx | ||
| --- | ||
|
|
||
| This guide walks you through generating, inspecting, and removing a Stellar identity using the CLI. | ||
|
|
||
| ### 1. Generate a New Identity | ||
|
|
||
| Run the following command to create a new keypair and save it under the alias named `carol`: | ||
|
|
||
| ```bash | ||
| stellar keys generate carol | ||
| ``` | ||
|
|
||
| Output: | ||
|
|
||
| ``` | ||
| ✅ Key saved with alias carol in ".config/soroban/identity/carol.toml" | ||
| ``` | ||
|
|
||
| The CLI stores this identity in a TOML file. | ||
|
|
||
| ### 2. Verify the Identity File | ||
|
|
||
| Navigate to the configuration directory and list the contents: | ||
|
|
||
| ```bash cookbooktest.ignore | ||
| cd .config/soroban/identity && ls | ||
| ``` | ||
|
|
||
| Output: | ||
|
|
||
| ``` | ||
| carol.toml | ||
| ``` | ||
|
|
||
| The file carol.toml contains the seed phrase for your identity. | ||
|
|
||
| ### 3. View the Seed Phrase | ||
|
|
||
| ```bash cookbooktest.ignore | ||
| cat carol.toml | ||
| ``` | ||
|
|
||
| Output: | ||
|
|
||
| ``` | ||
| seed_phrase = "patrol clean public grocery roof aim have valve cherry dismiss lunar tail duty license capable little version banana amount often cover dice couple party" | ||
| ``` | ||
|
|
||
| :::danger | ||
|
|
||
| Note: The seed phrase is sensitive information. Handle it with care and never expose it publicly. | ||
|
|
||
| ::: | ||
|
|
||
| ### 4. Derive the Secret Key | ||
|
|
||
| To display the secret key for the carol identity: | ||
|
|
||
| ```bash | ||
| stellar keys secret carol | ||
| ``` | ||
|
|
||
| Output: | ||
|
|
||
| ``` | ||
| SCJP663VYFZPYN75H2DYJA3FYUBP5UR23HZ4ZDHDMDY6TXVYUYMWNKTI | ||
| ``` | ||
|
|
||
| :::danger | ||
|
|
||
| Note: The secret key is sensitive information. Handle it with care and never expose it publicly. | ||
|
|
||
| ::: | ||
|
|
||
| ### 5. Derive the Public Key | ||
|
|
||
| To display the corresponding public key for the carol identity: | ||
|
|
||
| ```bash | ||
| stellar keys public-key carol | ||
| ``` | ||
|
|
||
| Output: | ||
|
|
||
| ``` | ||
| GD3BFFX7DTNJAGDVVM5RYGGQQNURZTH4VSBLWF55YXY3L6T2WWZK57EI | ||
| ``` | ||
|
|
||
| This is the public address of your key. | ||
|
|
||
| ### 6. Fund this account | ||
|
|
||
| ```bash | ||
| stellar keys fund carol | ||
|
janewang marked this conversation as resolved.
|
||
| ``` | ||
|
|
||
| Output: | ||
|
|
||
| ``` | ||
| ✅ Account carol funded on "Test SDF Network ; September 2015" | ||
| ``` | ||
|
|
||
| You can also fund the account while creating the key by using `stellar keys generate --fund`. | ||
|
|
||
| ### 7. Remove the Identity | ||
|
|
||
| When you no longer need this identity, remove it using: | ||
|
|
||
| ```bash | ||
| stellar keys rm carol | ||
| ``` | ||
|
|
||
| Output: | ||
|
|
||
| ``` | ||
| ℹ️ Removing the key's cli config file | ||
| ``` | ||
|
|
||
| At this point, the identity file carol.toml is deleted, and the alias is no longer available in the CLI. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.