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

Feature/environment multi #1959

Merged
merged 1 commit into from
Apr 10, 2023

Conversation

otherNet
Copy link
Contributor

@otherNet otherNet commented Mar 30, 2023

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

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@otherNet otherNet marked this pull request as draft March 30, 2023 20:30
@otherNet otherNet force-pushed the feature/environment_Multi branch 4 times, most recently from 2a5b6ac to bedae33 Compare April 6, 2023 14:10
- hashgraph#1696

integrate previous changes to Dokerfile
docs and PREUSED
GUARDIAN_ENV in .env
Docs: Docker Compose V2 version
lint

Signed-off-by: otherNet <francesco.calderoni@intellecteu.com>
@otherNet otherNet force-pushed the feature/environment_Multi branch from bedae33 to 17ee127 Compare April 6, 2023 14:49
@otherNet otherNet marked this pull request as ready for review April 6, 2023 15:42
@simvalery simvalery merged commit f8510c2 into hashgraph:develop Apr 10, 2023
@ieumuzair ieumuzair added the IEU Intellect EU Team label Apr 11, 2023
@otherNet otherNet mentioned this pull request Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IEU Intellect EU Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants