Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1888, Fixes #1696.
The implementation goes in the same line as the PR 1822 and it is possible to install directly this one because this solution includes the solution for that issue too.
In order to discriminate data stored to the database it has been introduced a different database name per each couple <GUARDIAN_ENV, HEDERA_NET>.
In this way the user will be able to use the same infrastructure and maintain their data referring to different Hedera network and different Guardian Ecosystem Environment completely separated from each other
The global .env contains the only variable: GUARDIAN_ENV.
it introduces the variable PREUSED_HEDERA_NET to let specify the hedera net already in use.
.env example:
GUARDIAN_ENV=develop
it add the new PREUSED_HEDERA_NET variable in each service environment both in the .env and .env.docker files
# configure this variable only at first installation of the release
PREUSED_HEDERA_NET=testnet
Change db name in the db-helper.ts common library introducing parametric name of the kind:
${process.env.ENV}${process.env.HEDERA_NET}${process.env.DB_DATABASE}
The dbName variable is set by a ternary operator to keep current database name unchanged and maintain the already created database and data unchanged.
More docs are provided at:
- https://github.com/IntellectEU/guardian/blob/feature/environment_Multi/docs/environments/persistance-configuration-according-environment.md
Related issue(s):
Fixes #1888, #1696.
Notes for reviewer:
Checklist