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 /v1/:chainId/about/indexing endpoint #1826

Merged
merged 6 commits into from
Aug 20, 2024
Merged

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented Aug 15, 2024

Summary

This adds a new GET /v1/:chainId/about/indexing endpoint for returning the indexer status relative to the current block timestamp:

type Response = {
  lastSync: number // timestamp of oldest block synced by singleton or ERC-20/721 indexers
  synced: boolean // if Transaction Service returns `true` both singletons and ERC-20/721 indexers
}

Changes

  • Add expirationTimeInSeconds.indexing configuration
  • Add indexing cache key
  • Add IndexingStatusSchema with inferred type/builder
  • Add ITransactionApi['getIndexingStatus'] method and implementation
  • Add `ChainsRepository['getIndexingStatus'] method
  • Add GET /v1/:chainId/about/indexing route with entity
  • Add appropriate test coverage

@iamacook iamacook self-assigned this Aug 15, 2024
@iamacook iamacook requested a review from a team as a code owner August 15, 2024 14:35
@iamacook iamacook linked an issue Aug 15, 2024 that may be closed by this pull request
@coveralls
Copy link

coveralls commented Aug 15, 2024

Pull Request Test Coverage Report for Build 10454748393

Details

  • 16 of 32 (50.0%) changed or added relevant lines in 9 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 46.789%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/datasources/cache/cache.router.ts 1 2 50.0%
src/routes/chains/chains.controller.ts 2 3 66.67%
src/routes/chains/entities/indexing-status.entity.ts 4 6 66.67%
src/domain/chains/chains.repository.ts 1 4 25.0%
src/routes/chains/chains.service.ts 3 7 42.86%
src/datasources/transaction-api/transaction-api.service.ts 1 6 16.67%
Totals Coverage Status
Change from base Build 10454727634: 0.02%
Covered Lines: 4580
Relevant Lines: 7907

💛 - Coveralls

hectorgomezv
hectorgomezv previously approved these changes Aug 19, 2024
Base automatically changed from cache-rpc-requests to main August 19, 2024 13:54
@iamacook iamacook dismissed hectorgomezv’s stale review August 19, 2024 13:54

The base branch was changed.

@iamacook iamacook merged commit 6d0ffb1 into main Aug 20, 2024
16 checks passed
@iamacook iamacook deleted the about-indexing-endpoint branch August 20, 2024 14:57
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.

Implement method to get indexing status
3 participants