Skip to content

Read keyfile and select the address#3163

Merged
nkuba merged 10 commits intomainfrom
read-keyfile
Aug 22, 2022
Merged

Read keyfile and select the address#3163
nkuba merged 10 commits intomainfrom
read-keyfile

Conversation

@dimpar
Copy link
Copy Markdown
Contributor

@dimpar dimpar commented Aug 13, 2022

Refs #3135

Depends on #3148

In this PR we add an option to select the config file during initialze.sh script which will prompt to pick the config file and will fetch the stake owner address from the key file.

Now you can simply run scripts/initialize.sh without providing --stake-owner <address>

When the --stake-owner flag is not set, we can read the stake owner
address from the config key file. This script will prompt to pick from
available config files and will fetch the address automatically.
@dimpar dimpar changed the title Read keyfile Read keyfile and select the address Aug 13, 2022
@dimpar dimpar requested a review from nkuba August 13, 2022 16:46
@dimpar dimpar self-assigned this Aug 13, 2022
@dimpar dimpar mentioned this pull request Aug 13, 2022
1 task
Comment thread scripts/initialize.sh Outdated
Comment thread scripts/initialize.sh Outdated
Comment thread scripts/initialize.sh Outdated
Comment thread scripts/initialize.sh Outdated
Comment thread scripts/initialize.sh
Comment thread scripts/initialize.sh Outdated
fi
done

key_file_path=$(awk '/keyFile ?=(.*)$/{print $3}' $CONFIG_FILE_PATH | xargs)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's support both KeyFile and keyFile as the TOML configuration file is not strict about properties cases.

Suggested change
key_file_path=$(awk '/keyFile ?=(.*)$/{print $3}' $CONFIG_FILE_PATH | xargs)
key_file_path=$(awk '/[k|K]eyFile ?=(.*)$/{print $3}' $CONFIG_FILE_PATH | xargs)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nkuba nkuba merged commit 53e8c2e into main Aug 22, 2022
@nkuba nkuba deleted the read-keyfile branch August 22, 2022 12:33
@pdyraga pdyraga added this to the v2.0.0-m1 milestone Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants