feat(run-manager): add keygen command to generate a new Solana keypair - #654
Open
Sahilvishnaliya wants to merge 2 commits into
Open
feat(run-manager): add keygen command to generate a new Solana keypair#654Sahilvishnaliya wants to merge 2 commits into
Sahilvishnaliya wants to merge 2 commits into
Conversation
Creates a new keypair and writes it as the same JSON format the solana-cli produces (solana-keygen new --outfile), so users no longer need the solana binaries just to create a wallet for joining runs. Closes PsycheFoundation#500
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a
run-manager keygencommand that generates a new Solana keypair and writes it to disk in the same JSON format the solana-cli produces, so creating a wallet no longer requires installing the solana binaries.Closes #500.
Usage
solana-keygen new --outfile), directly usable asWALLET_PATH/WALLET_PRIVATE_KEY_PATHin the.envfile.--forceis passed.write_to_filecreates parent directories and restricts permissions to0600on unix (both provided bysolana_sdk'sEncodableKeyimplementation)..envor RPC endpoint.Notes for reviewers
#[derive(Debug, Clone, Args)]+#[command()], registered inCommandsinmain.rs; dispatched without aSolanaBackendsince it needs no network access.Keypair::new()(OS entropy) +EncodableKey::write_to_fileare the same primitivessolana-keygenuses, via the already-requiredanchor-clientre-export ofsolana_sdk.run-manager keygenas the primary path (solana-cli kept as an alternative).cargo checkis blocked on Windows by the vendoredopenssl-sysbuild (needs perl; CI builds run on Ubuntu with libssl-dev), so compile verification is left to CI — the touched APIs (Keypair::new,write_to_file,pubkey) are verified against solana-sdk 2.1.4 sources.