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

[Refactor] Store values on .env file #106

Open
jmoreira-valory opened this issue Nov 17, 2023 · 1 comment
Open

[Refactor] Store values on .env file #106

jmoreira-valory opened this issue Nov 17, 2023 · 1 comment
Labels

Comments

@jmoreira-valory
Copy link
Collaborator

jmoreira-valory commented Nov 17, 2023

The run_service.sh script stores a number of variables as text files (e.g., rpc.txt). Instead, store these values within the .env files, unless they are not explicitly required in a file (e.g., the file agent_pkey.txt is required in a separate file, even though it is just the value of a private key).

The following approach should be used:

  • Implement a method set_env_var VAR VALUE which:
    • Creates the .env file if it does not exist.
    • Updates VAR=OLD_VALUE to VAR=VALUE if the entry for VAR exists in .env file.
    • Appends VAR=VALUE to the env file if VAR does not exist in the .env file.
    • exports VAR=VALUE to the environment to be used in the rest of the script.

The file .env should be sourced at the appropriate point at the start of the script.

#99 (comment)

@jmoreira-valory
Copy link
Collaborator Author

jmoreira-valory commented Nov 21, 2023

Partialy completed on #111 : The method is completed there, and used for USE_STAKING and AGENT_ID; the rest of the eligible variables are not addressed.

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

No branches or pull requests

1 participant