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

feat: add ability to store current indexed data #38

Merged
merged 9 commits into from
Aug 29, 2024
Merged

Conversation

azurwastaken
Copy link
Collaborator

Pull Request type

  • Feature

What is the current behavior?

Resolves: #36

What is the new behavior?

The bot now have a StorageTrait and a StorageWrapper that allow him to handle storage of current state (indexed position and last witnessed block by the monitoring)

currently there is only one possibility which is dumping into a json file. the service will dump every tick updated last witnessed block and positions map into the json.

At the start the run_all_service will initiate a jsonStorage that will read the json file and get the data in it.
if there is some data he will start the indexing service from the last synced block and the monitoring service's position map will be initialized with data from the json file.
Otherwise, we do as before.

Does this introduce a breaking change?

No

Other information

There is many TODO's related to this but as its for an mvp it look enough to me

@azurwastaken azurwastaken self-assigned this Aug 28, 2024
src/storage/json.rs Outdated Show resolved Hide resolved
src/storage/json.rs Outdated Show resolved Hide resolved
src/storage/storage_wrapper.rs Outdated Show resolved Hide resolved
src/types/position.rs Outdated Show resolved Hide resolved
@EvolveArt EvolveArt merged commit f5d5d7b into main Aug 29, 2024
6 checks passed
@EvolveArt EvolveArt deleted the feat/storage branch August 29, 2024 14:30
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.

feat: put indexed data into a storage object
3 participants