refactor(spo): merge spo-api into indexer-api#674
Merged
cosmir17 merged 2 commits intofeat/insource-spo-indexerfrom Jan 20, 2026
Merged
refactor(spo): merge spo-api into indexer-api#674cosmir17 merged 2 commits intofeat/insource-spo-indexerfrom
cosmir17 merged 2 commits intofeat/insource-spo-indexerfrom
Conversation
Move SPO GraphQL queries from standalone spo-api crate into indexer-api, following the existing storage trait abstraction pattern. This consolidates the API surface and eliminates the need for a separate SPO API service. Changes: - Add SPO domain types (SpoIdentity, PoolMetadata, EpochPerf, etc.) - Add SpoStorage trait with 18 storage methods - Implement SpoStorage for PostgreSQL (cloud) and SQLite (standalone) - Add SpoQuery GraphQL resolver with 20 query methods - Use MergedObject to combine Query and SpoQuery - Remove spo-api from workspace members - Update GraphQL schema with SPO queries
hseeberger
approved these changes
Jan 20, 2026
Collaborator
hseeberger
left a comment
There was a problem hiding this comment.
One comment, if possible to be addressed. Then merge.
indexer-api/src/infra/api/v3.rs
Outdated
|
|
||
| /// Merged Query combining core queries with SPO queries. | ||
| #[derive(MergedObject)] | ||
| pub struct MergedQuery<S: Storage>(Query<S>, SpoQuery<S>); |
Collaborator
There was a problem hiding this comment.
Do we have to use a merged query? Why not fold everything into Query? If too much work now, please leave a TODO comment.
Contributor
Author
There was a problem hiding this comment.
Done. Folded all SPO query methods into Query and removed MergedObject.
Addressed in 5c2794a commit.
Move all SPO query methods from separate SpoQuery struct into the main Query struct, eliminating the need for MergedObject. This simplifies the GraphQL schema structure as suggested in PR review.
49d3b70 to
5c2794a
Compare
cosmir17
added a commit
that referenced
this pull request
Jan 29, 2026
- Delete spo-api/ directory (merged into indexer-api in PR #674) - Delete outdated MIGRATION.md (ProtoFire migration docs) - Remove spo-api service from docker-compose.yaml - Add SPO tables to SQLite migration for standalone mode
cosmir17
added a commit
that referenced
this pull request
Jan 29, 2026
#661) * fix: update reqwest feature from rustls-tls to rustls for reqwest 0.13 compatibility * refactor(spo): apply PR #526 review comments - Replace println!/eprintln! with log::{debug, error, info, warn} - Replace .unwrap() with .expect() with meaningful messages - Add SIGTERM handling to spo-indexer (graceful shutdown) - Fix telemetry service_name: "chain-indexer" → "spo-indexer" - Remove Blockfrost ID from config.yaml (use env var instead) - Consolidate SPO SQL migrations into 003_spo.sql - Remove unused imports in spo-indexer * style(spo): apply indexer code style patterns Apply coding conventions: lowercase logs, inline format args, turbofish, to_owned(), doc comment periods, and imports at file top. * feat(spo-api): add GraphQL schema generation CLI Add spo-api-cli binary with print-api-schema-v1 command and justfile target to generate spo-api/graphql/schema-v1.graphql. * refactor(spo): address PR #661 review comments Apply coding style fixes including SIGTERM casing, typed APIs, proper error handling, and import patterns. Consolidate SPO migrations into 001_initial.sql. * refactor(spo): merge spo-api into indexer-api (#674) * refactor(spo): merge spo-api into indexer-api Move SPO GraphQL queries from standalone spo-api crate into indexer-api, following the existing storage trait abstraction pattern. This consolidates the API surface and eliminates the need for a separate SPO API service. Changes: - Add SPO domain types (SpoIdentity, PoolMetadata, EpochPerf, etc.) - Add SpoStorage trait with 18 storage methods - Implement SpoStorage for PostgreSQL (cloud) and SQLite (standalone) - Add SpoQuery GraphQL resolver with 20 query methods - Use MergedObject to combine Query and SpoQuery - Remove spo-api from workspace members - Update GraphQL schema with SPO queries * refactor(spo): fold SpoQuery into Query Move all SPO query methods from separate SpoQuery struct into the main Query struct, eliminating the need for MergedObject. This simplifies the GraphQL schema structure as suggested in PR review. * refactor(spo): address PR #661 review comments (2nd round) * refactor(spo): delete spo-api crate and add SQLite SPO tables - Delete spo-api/ directory (merged into indexer-api in PR #674) - Delete outdated MIGRATION.md (ProtoFire migration docs) - Remove spo-api service from docker-compose.yaml - Add SPO tables to SQLite migration for standalone mode
cosmir17
added a commit
that referenced
this pull request
Feb 3, 2026
#661) * fix: update reqwest feature from rustls-tls to rustls for reqwest 0.13 compatibility * refactor(spo): apply PR #526 review comments - Replace println!/eprintln! with log::{debug, error, info, warn} - Replace .unwrap() with .expect() with meaningful messages - Add SIGTERM handling to spo-indexer (graceful shutdown) - Fix telemetry service_name: "chain-indexer" → "spo-indexer" - Remove Blockfrost ID from config.yaml (use env var instead) - Consolidate SPO SQL migrations into 003_spo.sql - Remove unused imports in spo-indexer * style(spo): apply indexer code style patterns Apply coding conventions: lowercase logs, inline format args, turbofish, to_owned(), doc comment periods, and imports at file top. * feat(spo-api): add GraphQL schema generation CLI Add spo-api-cli binary with print-api-schema-v1 command and justfile target to generate spo-api/graphql/schema-v1.graphql. * refactor(spo): address PR #661 review comments Apply coding style fixes including SIGTERM casing, typed APIs, proper error handling, and import patterns. Consolidate SPO migrations into 001_initial.sql. * refactor(spo): merge spo-api into indexer-api (#674) * refactor(spo): merge spo-api into indexer-api Move SPO GraphQL queries from standalone spo-api crate into indexer-api, following the existing storage trait abstraction pattern. This consolidates the API surface and eliminates the need for a separate SPO API service. Changes: - Add SPO domain types (SpoIdentity, PoolMetadata, EpochPerf, etc.) - Add SpoStorage trait with 18 storage methods - Implement SpoStorage for PostgreSQL (cloud) and SQLite (standalone) - Add SpoQuery GraphQL resolver with 20 query methods - Use MergedObject to combine Query and SpoQuery - Remove spo-api from workspace members - Update GraphQL schema with SPO queries * refactor(spo): fold SpoQuery into Query Move all SPO query methods from separate SpoQuery struct into the main Query struct, eliminating the need for MergedObject. This simplifies the GraphQL schema structure as suggested in PR review. * refactor(spo): address PR #661 review comments (2nd round) * refactor(spo): delete spo-api crate and add SQLite SPO tables - Delete spo-api/ directory (merged into indexer-api in PR #674) - Delete outdated MIGRATION.md (ProtoFire migration docs) - Remove spo-api service from docker-compose.yaml - Add SPO tables to SQLite migration for standalone mode
cosmir17
added a commit
that referenced
this pull request
Feb 4, 2026
#661) * fix: update reqwest feature from rustls-tls to rustls for reqwest 0.13 compatibility * refactor(spo): apply PR #526 review comments - Replace println!/eprintln! with log::{debug, error, info, warn} - Replace .unwrap() with .expect() with meaningful messages - Add SIGTERM handling to spo-indexer (graceful shutdown) - Fix telemetry service_name: "chain-indexer" → "spo-indexer" - Remove Blockfrost ID from config.yaml (use env var instead) - Consolidate SPO SQL migrations into 003_spo.sql - Remove unused imports in spo-indexer * style(spo): apply indexer code style patterns Apply coding conventions: lowercase logs, inline format args, turbofish, to_owned(), doc comment periods, and imports at file top. * feat(spo-api): add GraphQL schema generation CLI Add spo-api-cli binary with print-api-schema-v1 command and justfile target to generate spo-api/graphql/schema-v1.graphql. * refactor(spo): address PR #661 review comments Apply coding style fixes including SIGTERM casing, typed APIs, proper error handling, and import patterns. Consolidate SPO migrations into 001_initial.sql. * refactor(spo): merge spo-api into indexer-api (#674) * refactor(spo): merge spo-api into indexer-api Move SPO GraphQL queries from standalone spo-api crate into indexer-api, following the existing storage trait abstraction pattern. This consolidates the API surface and eliminates the need for a separate SPO API service. Changes: - Add SPO domain types (SpoIdentity, PoolMetadata, EpochPerf, etc.) - Add SpoStorage trait with 18 storage methods - Implement SpoStorage for PostgreSQL (cloud) and SQLite (standalone) - Add SpoQuery GraphQL resolver with 20 query methods - Use MergedObject to combine Query and SpoQuery - Remove spo-api from workspace members - Update GraphQL schema with SPO queries * refactor(spo): fold SpoQuery into Query Move all SPO query methods from separate SpoQuery struct into the main Query struct, eliminating the need for MergedObject. This simplifies the GraphQL schema structure as suggested in PR review. * refactor(spo): address PR #661 review comments (2nd round) * refactor(spo): delete spo-api crate and add SQLite SPO tables - Delete spo-api/ directory (merged into indexer-api in PR #674) - Delete outdated MIGRATION.md (ProtoFire migration docs) - Remove spo-api service from docker-compose.yaml - Add SPO tables to SQLite migration for standalone mode
cosmir17
added a commit
that referenced
this pull request
Feb 4, 2026
* feat(spo): integrate spo indexer Originally authored by caparrosm (ProtoFire). Commit was unsigned and blocked PR merge due to repo requiring verified signatures. Amended author and re-signed to unblock. * fix(spo): apply review comments and coding style to ProtoFire SPO code (#661) * fix: update reqwest feature from rustls-tls to rustls for reqwest 0.13 compatibility * refactor(spo): apply PR #526 review comments - Replace println!/eprintln! with log::{debug, error, info, warn} - Replace .unwrap() with .expect() with meaningful messages - Add SIGTERM handling to spo-indexer (graceful shutdown) - Fix telemetry service_name: "chain-indexer" → "spo-indexer" - Remove Blockfrost ID from config.yaml (use env var instead) - Consolidate SPO SQL migrations into 003_spo.sql - Remove unused imports in spo-indexer * style(spo): apply indexer code style patterns Apply coding conventions: lowercase logs, inline format args, turbofish, to_owned(), doc comment periods, and imports at file top. * feat(spo-api): add GraphQL schema generation CLI Add spo-api-cli binary with print-api-schema-v1 command and justfile target to generate spo-api/graphql/schema-v1.graphql. * refactor(spo): address PR #661 review comments Apply coding style fixes including SIGTERM casing, typed APIs, proper error handling, and import patterns. Consolidate SPO migrations into 001_initial.sql. * refactor(spo): merge spo-api into indexer-api (#674) * refactor(spo): merge spo-api into indexer-api Move SPO GraphQL queries from standalone spo-api crate into indexer-api, following the existing storage trait abstraction pattern. This consolidates the API surface and eliminates the need for a separate SPO API service. Changes: - Add SPO domain types (SpoIdentity, PoolMetadata, EpochPerf, etc.) - Add SpoStorage trait with 18 storage methods - Implement SpoStorage for PostgreSQL (cloud) and SQLite (standalone) - Add SpoQuery GraphQL resolver with 20 query methods - Use MergedObject to combine Query and SpoQuery - Remove spo-api from workspace members - Update GraphQL schema with SPO queries * refactor(spo): fold SpoQuery into Query Move all SPO query methods from separate SpoQuery struct into the main Query struct, eliminating the need for MergedObject. This simplifies the GraphQL schema structure as suggested in PR review. * refactor(spo): address PR #661 review comments (2nd round) * refactor(spo): delete spo-api crate and add SQLite SPO tables - Delete spo-api/ directory (merged into indexer-api in PR #674) - Delete outdated MIGRATION.md (ProtoFire migration docs) - Remove spo-api service from docker-compose.yaml - Add SPO tables to SQLite migration for standalone mode * refactor(spo): move updated_at logic from DB trigger to application layer (PM-21550) (#725) * fix(spo): replace deprecated sidechain_getAriadneParameters RPC (#727) Use systemParameters_getAriadneParameters which sources the D Parameter from the on-chain pallet instead of Cardano. * refactor(spo): remove static metadata and OnlineClient from spo-indexer (#731) * refactor(spo): remove static metadata and OnlineClient from spo-indexer Delete ProtoFire's polkadot_metadata.scale, subxt macro, and build.rs. Replace get_block_timestamp with a DB query on the blocks table (populated by chain-indexer) and rewrite get_epoch_duration to use LegacyRpcMethods instead of OnlineClient. * feat(spo): add run-spo-indexer command to justfile * style(spo): apply rustfmt formatting * refactor: apply review feedback on get_block_timestamp * fix(spo): remove MIN_COMMITTEE_SIZE retry loop from get_committee The infinite retry loop waited for >= 300 committee members before proceeding, causing the spo-indexer to hang on all non-mainnet environments where committee sizes are much smaller (e.g. 6-10). * fix(spo): align Dockerfile with other indexer components * ci: add spo-indexer to Docker image build matrix (#744) * update Cargo.lock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Move SPO GraphQL queries from standalone spo-api crate into indexer-api, following the existing storage trait abstraction pattern. This consolidates the API surface and eliminates the need for a separate SPO API service.
Changes:
Merging this PR to #661
This PR's sql queries require significant refactoring. @hseeberger feel free to modify this PR 🙏