feat: add ability to store current indexed data #38
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.
Pull Request type
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