Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

Allow substrate network to be specified on key generation #481

Closed
ansermino opened this issue Jul 16, 2020 · 0 comments · Fixed by #484
Closed

Allow substrate network to be specified on key generation #481

ansermino opened this issue Jul 16, 2020 · 0 comments · Fixed by #484
Assignees

Comments

@ansermino
Copy link
Member

This PR exposes the ability to specify a network ID when generating keys with GSRPC. We should extend the accounts generate command to allow a user to specify this when generating sr25519 (substrate) keys.

Here's where the key generation gets called by the CLI:

if keytype == crypto.Sr25519Type {
// generate sr25519 keys
kp, err = sr25519.GenerateKeypair()
if err != nil {
return "", fmt.Errorf("could not generate sr25519 keypair: %s", err)
}

We'll need to update this method to pass the network string:

func GenerateKeypair() (*Keypair, error) {

(Probably best to use a local replace directive if the PR is still pending, issues do a replace with branch name golang/go#30851 (comment))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants