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

add piping for update #96

Merged
merged 3 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,9 @@ jobs:
- name: Check operator status
run: |
cd eigenlayer-cli
./bin/eigenlayer operator status operator-ci.yaml
./bin/eigenlayer operator status operator-ci.yaml

- name: Update operator details
run: |
cd eigenlayer-cli
echo "" | ./bin/eigenlayer operator update operator-ci.yaml
2 changes: 1 addition & 1 deletion pkg/operator/config/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func promptOperatorInfo(config *types.OperatorConfigNew, p utils.Prompter) (type
config.PrivateKeyStorePath = ecdsaKeyPath

// Prompt for network & set chainId
chainId, err := p.Select("Select your network:", []string{"mainnet", "goerli", "holesky", "local"})
chainId, err := p.Select("Select your network:", []string{"mainnet", "holesky", "local"})
if err != nil {
return types.OperatorConfigNew{}, err
}
Expand Down
20 changes: 12 additions & 8 deletions pkg/operator/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,18 @@ func UpdateCmd(p utils.Prompter) *cli.Command {
return err
}

ecdsaPassword, err := p.InputHiddenString("Enter password to decrypt the ecdsa private key:", "",
func(password string) error {
return nil
},
)
if err != nil {
fmt.Printf("%s Error while reading ecdsa key password\n", utils.EmojiCrossMark)
return err
// Check if input is available in the pipe and read the password from it
ecdsaPassword, readFromPipe := utils.GetStdInPassword()
if !readFromPipe {
ecdsaPassword, err = p.InputHiddenString("Enter password to decrypt the ecdsa private key:", "",
func(password string) error {
return nil
},
)
if err != nil {
fmt.Println("Error while reading ecdsa key password")
return err
}
}

signerCfg := signerv2.Config{
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var ChainMetadataMap = map[int64]types.ChainMetadata{
MainnetChainId: {
BlockExplorerUrl: "https://etherscan.io/tx",
ELDelegationManagerAddress: "0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A",
ELAVSDirectoryAddress: "",
ELAVSDirectoryAddress: "0x135dda560e946695d6f155dacafc6f1f25c1f5af",
},
GoerliChainId: {
BlockExplorerUrl: "https://goerli.etherscan.io/tx",
Expand Down
Loading