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

Make mock ASE seeding script smarter #2945

Closed
2 tasks
mkurapov opened this issue Sep 4, 2024 · 0 comments · Fixed by #3050
Closed
2 tasks

Make mock ASE seeding script smarter #2945

mkurapov opened this issue Sep 4, 2024 · 0 comments · Fixed by #3050
Assignees
Labels

Comments

@mkurapov
Copy link
Contributor

mkurapov commented Sep 4, 2024

Context

Currently, when we start up the mock ASE, we run a seed script. This seed script calls the Admin API to create assets, peers, wallet addresses and add liquidity where necessary. After this, the script creates mock user accounts in memory. These mock accounts are needed to properly receive and send payments between wallet addresses (since without mock accounts, the webhook handlers do not know who to debit/credit).

However, we run into an issue when we spin down the local environment, but do not clear the Rafiki database: the seed script sees that the data has been seeded already, and exits early, without creating mock user accounts. As a result, we cannot process payments, since the webhook handlers would not be able to find the corresponding accounts.

We should change the seed script, such that it checks if the assets, peers, wallet addresses, etc already exist in Rafiki. If they do, make mock accounts based on that. Otherwise, we should proceed as normal, and create missing resources in Rafiki.

The outcome of this is that if the local playground is spun down without deleting any volumes, spinning the environment back up populates the mock accounts correctly, and payments are able to be processed as usual.

Todos

  • Make seed script in mock ASE handle existing data OR use some database in the MASE to store account data - discuss with the team with your proposed solution
  • Create an issue for the documentation (we need to update the commands for the local playground to not have to specify to down volumes before we do pnpm localenv:compose up)
@github-project-automation github-project-automation bot moved this to Backlog in Rafiki Sep 4, 2024
@oana-lolea oana-lolea moved this from Backlog to In Progress in Rafiki Oct 15, 2024
@oana-lolea oana-lolea moved this from In Progress to Ready for Review in Rafiki Oct 29, 2024
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in Rafiki Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants