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

chore: migrate blockchain-scraper to nestjs #54

Draft
wants to merge 7 commits into
base: development
Choose a base branch
from

Conversation

FidelVe
Copy link
Collaborator

@FidelVe FidelVe commented Jan 3, 2025

The following PR is for migrating the blockchain-scraper to nestjs to improve current issues with logging, difficulty to add tasks, bloated code logic etc

An initial commit has been created with a a basic framework created as a proof of concept, the changes made in this initial commit are the following:

  • old code logic moved to a folder named db-manager-old
  • new nestjs logic added to folder called db-manager
  • rabbitmq is used as a message broker to handle task execution
  • a logic for "recurring tasks" was created to showcase how our current once-a-day task can be executed, the sample code currently execute dummy tasks every 10 seconds but in this logic block we can add the feature to check for the chain period in the ICON blockchain or simply run the recurring tasks once a day based on time
  • a logic for "triggered task" was also added. the app exposes one sample endpoint (/subscribe-newsletter) to showcase how we can trigger task that need immediate execution, when the endpoint is called a message is queue in rabbitmq and the task is then consumed and triggered immediately
  • Logging was added with winston package and typescript was used

DO NOT merge yet this is a proof of concept

@FidelVe FidelVe requested a review from R0bi7 January 3, 2025 16:59
…mption to be halted when a special message has been sent to the queue and resuming consumption once the special message has been fully processed
…orted tasks in old blockchain scraper logic. refactored all required logic to run all the tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant