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

Add VersionTrackerStep to Common Steps in the SDK #63

Merged
merged 11 commits into from
Oct 9, 2024

Conversation

dermanyang
Copy link
Contributor

@dermanyang dermanyang commented Oct 8, 2024

Purpose

Introduce the LatestVersionProcessedTracker as a common step in the SDK so processors across in aptos-indexer-processors and aptos-indexer-processor-example can reuse the same code.

Example usage in PR#8 of the example repo:

let version_tracker = VersionTrackerStep::new(
            self.config.processor_config.name().to_string(),
            ProcessorStatusSaverImpl {
                conn_pool: self.db_pool.clone(),
            },
            UPDATE_PROCESSOR_STATUS_SECS,
        );
...

Technical Overview

To prevent a migrations/ directory in the SDK which would cause many forks an adapter trait object, ProcessorStatusSaver with method save_processor_status, is used.

Testing

Tested manually in examples repo by refactoring the events processor to use this step: aptos-labs/aptos-indexer-processor-example#8

@dermanyang dermanyang changed the title WIP [WIP] Add version tracker to sdk Oct 8, 2024
@dermanyang dermanyang changed the title [WIP] Add version tracker to sdk Add VersionTrackerStep to Common Steps in the SDK Oct 8, 2024
@dermanyang dermanyang marked this pull request as ready for review October 8, 2024 23:03
@dermanyang dermanyang requested a review from a team as a code owner October 8, 2024 23:03
@dermanyang dermanyang requested a review from rtso October 8, 2024 23:03
@dermanyang dermanyang merged commit 41f12b4 into main Oct 9, 2024
2 checks passed
@dermanyang dermanyang deleted the sdy/version_tracker branch October 9, 2024 20:17
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.

2 participants