Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Commit

Permalink
add key location
Browse files Browse the repository at this point in the history
  • Loading branch information
shrimalmadhur committed Oct 11, 2023
1 parent 8529a2f commit 9d27e47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cli/operator/keys/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ This command will create keys in ./operator_keys/ location
}

func saveBlsKey(keyName string, p prompter.Prompter, keyPair *bls.KeyPair, insecure bool) error {
// TODO: Path should be relative to user home dir https://github.com/NethermindEth/eigenlayer/issues/109
basePath, _ := os.Getwd()
keyFileName := keyName + ".bls.key.json"
if checkIfKeyExists(keyFileName) {
Expand Down Expand Up @@ -146,6 +147,7 @@ func saveBlsKey(keyName string, p prompter.Prompter, keyPair *bls.KeyPair, insec
}

func saveEcdsaKey(keyName string, p prompter.Prompter, privateKey *ecdsa.PrivateKey, insecure bool) error {
// TODO: Path should be relative to user home dir https://github.com/NethermindEth/eigenlayer/issues/109
basePath, _ := os.Getwd()
keyFileName := keyName + ".ecdsa.key.json"
if checkIfKeyExists(keyFileName) {
Expand Down
4 changes: 4 additions & 0 deletions cli/operator/keys/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ func ListCmd(p prompter.Prompter) *cobra.Command {
return err
}

// TODO: Path should be relative to user home dir https://github.com/NethermindEth/eigenlayer/issues/109
basePath, _ := os.Getwd()
for _, file := range files {
keySplits := strings.Split(file.Name(), ".")
fileName := keySplits[0]
Expand All @@ -40,6 +42,7 @@ func ListCmd(p prompter.Prompter) *cobra.Command {
return err
}
fmt.Println("Address: 0x" + address)
fmt.Println("Key location: " + basePath + "/" + OperatorKeyFolder + "/" + file.Name())
fmt.Println("====================================================================================")
fmt.Println()
case KeyTypeBLS:
Expand All @@ -49,6 +52,7 @@ func ListCmd(p prompter.Prompter) *cobra.Command {
return err
}
fmt.Println("Public Key: " + pubKey)
fmt.Println("Key location: " + basePath + "/" + OperatorKeyFolder + "/" + file.Name())
fmt.Println("====================================================================================")
fmt.Println()
}
Expand Down

0 comments on commit 9d27e47

Please sign in to comment.